Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Install tips for PHP's pecl_http on 64-bit Intel Macs UNIX
Here are some tips for getting the PHP 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 PHP Documentation pages 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 (Xcode) 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 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 PHP installation I substituted for the bundled PHP installation. I needed the version because it has the PDO_MYSQL extension and driver I need for the Zend Framework.

    Note that using the 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.
  4. 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.
  5. As is made clear elsewhere, you need to add the following to your php.ini where all other extensions to load are listed: I did not comment out the extension_dir="./" line as some suggest, and I had no problems.
  6. 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.
Read the rest of the hint for the details on the required change to the Apache file noted in the last item above...

Here's the file to change:
I have 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), and here are the needed substitute file contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
That's it, and good luck!
  • Currently 2.38 / 5
  You rated: 2 / 5 (8 votes cast)

10.5: Install tips for PHP's pecl_http on 64-bit Intel Macs | 2 comments | Create New Account
Click here to return to the '10.5: Install tips for PHP's pecl_http on 64-bit Intel Macs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Install tips for PHP's pecl_http on 64-bit Intel Macs
Authored by: navaho on Nov 21, '08 12:03:43PM

So, your tip is to discard the existing PHP build, install Entropy's 32 bit build, compile PECL against that, and then force your apache to run 32 bit on your 64 bit machine? Questionable strategy.

[ Reply to This | # ]
10.5: Install tips for PHP's pecl_http on 64-bit Intel Macs
Authored by: mangst on May 01, '09 03:32:45PM

Thanks for posting. This was exactly the problem I was having. I downloaded the older version of the extension and made those changes to the org.apach.httpd.plist file and it worked!

I had to change the "extension_dir" parameter in my php.ini to the place where the file resides:

extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613/"

@navaho: I didn't have to install the PHP installation...just used the PHP installation that came with my Mac.

[ Reply to This | # ]