Tips for getting the pecl_http extension running on a Macintosh OS X 10.5.x Leopard 64-bit intel machine.
For starters, you need to follow the instructions in the subsequent pages here to install the PEAR/PECL manager because it is no longer in the standard OS X setup.
(1) To compile the extension, you have to install the Developers XTools from your system disks because they are not installed by default. This is a simple step.
(2) it's not made clear that you need to install an older version of pecl_http than the latest stable version (1.6.1 as of this writing) because the 1.6.1 needs PHP6. I used version 1.5.6 successfully. So, your Terminal command has to be --
sudo pecl install pecl_http-1.5.6
(3) There is apparently a libcurl dependency in the case of pecl_http (although no dependencies are listed at the extension site), but it came with the excellent entropy.ch PHP installation I substituted for the standard PHP installation that comes with the operating system. I needed the entropy.ch version because it has the PDO_MYSQL extension and driver I need for the Zend Framework.
Note that using the entropy.ch substitute can confuse the PECL install manager (it may place the compiled extension in the wrong place for the substitute) -- it's easy enough to move (mv) it after it's successfully compiled.
(5) Once compiled and located properly, you may need to chmod the rights for the extension. I had to to make it comparable to the others in the extensions directory -- not sure this was strictly necessary, but I thought it would help to have them similarly owned and permitted.
(6) As is made clear elsewhere, you need to add the following to your php.ini where all other extensions to load are listed:
extension=http.so
I did not comment out the "extension_dir="./" line as some suggest, and I got no problems.
(7) Last and perhaps most important, I had to change the underlying apache startup plist file so that it comes up in 32-bit mode --it never worked under the standard 64-bit mode.
Here's the file to change:
/System/Library/LaunchDaemons/org.apache.httpd.plist
I've no idea if this is a so-called "bug" or just something I should have recognized on my own. Anyway, here's a link to what the substituted contents should be (found about two-thirds of the way down the page):
http://www.entropy.ch/phpbb2/viewtopic.php?p=11260#11260
Also, here's the needed substitute file contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.apache.httpd</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>arch</string>
<string>-arch</string>
<string>i386</string>
<string>/usr/sbin/httpd</string>
<string>-D</string>
<string>FOREGROUND</string>
</array>
<key>SHAuthorizationRight</key>
<string>system.preferences</string>
</dict>
</plist>
That's it, and good luck
PECL 拡張モジュールのインストール
目次
- PECL 拡張モジュールをダウンロードする
- PHP 拡張モジュールのインストール
- 拡張モジュールの探し方は?
- 共有 PECL 拡張モジュールを、pecl コマンドを用いてコンパイルする
- phpize で共有 PECL 拡張モジュールをコンパイルする方法
- PECL 拡張モジュールを PHP に静的に組み込む
PECL インストール入門
» PECL は PHP 拡張モジュールのリポジトリで、 » PEAR パッケージシステムを経由して使用可能です。 ここでは PECL 拡張モジュールを取得してインストールする方法を解説します。
以下に示す手順では、PHP のソース配布物へのパスが /your/phpsrcdir/ であり、PECL 拡張モジュールの名前が extname であると仮定しています。適切に変更してください。また、 » pear コマンド についても理解していることとします。 PEAR マニュアルにある pear コマンドについての情報は、 そのまま pecl コマンドにもあてはまります。
便利な機能を使用するには、拡張モジュールをビルドし、 インストールして読み込まなければなりません。 拡張モジュールのビルドとインストールについては以下でさまざまな方法を説明しますが、 モジュールの読み込みは自動的には行われません。モジュールを読み込むには、 php.ini ファイルに extension ディレクティブを追加するか、dl() 関数を使用します。
拡張モジュールのビルドにあたっては、適切なバージョンのツール (autoconf, automake, libtool など) を使用することが重要です。 必要なツールとそのバージョンについては、 » Anonymous CVS の手順 を参照してください。
PECL 拡張モジュールのインストール
tom dot herlihy at NOSPAM dot dot dot gov
16-Nov-2008 11:17
16-Nov-2008 11:17
kis at grosshat dot com
04-Jun-2008 10:52
04-Jun-2008 10:52
If it's not running for you even PEAR installed try to make an upgrade of PEAR (pear upgrade PEAR).
rbemrose at gmail dot com
17-Mar-2007 07:04
17-Mar-2007 07:04
If you are using a Debian sarge system (currently the stable release) with php4-pear installed, you will still not have a pecl command.
The fix to this is to upgrade pear.
Unfortunately, pear upgrade PEAR will also error out stating that you need pear-1.3.3 minimum.
The fix to this is to specify the version of pear that you want to install. In case it wasn't obvious, that means you want to
pear upgrade PEAR-1.3.3
pear upgrade-all
