0

I've done all the things suggested by other answers to this question (or at least I think I have), but I'm still completely stuck.

The specific problem going on at the moment is that the compiler can't find zend_config.h. I have PHP 5.5.10, which came with my out-of-the-box MAMP install. My first attempts were failing because the compiler couldn't find php.h. It seems that I need the PHP source code in order to build the mongo driver. A surprise to me (perhaps I'm too much of a n00b), but ok.

Unfortunately, I could not find the source for 5.5.10, only 5.5.14. Who knows whether that's what I really need. Out of desperation, I copied the main and Zend folders from 5.5.14 to my 5.5.10 folder. So I have php.h, but now no zend_config.h. There are zend_config.w32.h and zend_config.nw under the Zend folder. I guess I could take a desperate measure again and try renaming one of these files to see whether the extension will build, but I'd rather hear from someone who knows what they're doing.

Other answers to this kind of question say that you need the XCode command-line tools. I'm running Mavericks, so I got the command-line tools for Mavericks. I have XCode 5.1.1; I realize that it's up to V6 now, but do I really need the latest version of XCode for this? The installation of MongoDB itself using homebrew was beautifully uneventful. I got the mongo extension source from github and I'm following the very brief instructions from that repo.

I'm amazed that installing a simple extension would be this hard. I sure hope mongodb is enough of a performance improvement to justify this much headache. Can anyone give me an idea of how to get this going?

SaganRitual
  • 3,143
  • 2
  • 24
  • 40
  • You should be fine building with 5.5.14 vs 5.5.10 as the major versions (5.5.x) will use the same PHP API. The PHP download page only shows the latest versions, but if you want to get the exact version you can find it under [Old Archives](http://php.net/downloads.php) in the list of links on the right side of the page. This question may be helpful: http://stackoverflow.com/questions/21558690/mongo-php-driver-with-mamp; it's likely you are accidentally using a mix of the system PHP (installed with OS X) and the version of PHP you want to build against for MAMP. – Stennie Jul 22 '14 at 23:19

1 Answers1

0

I had this same issue. It might be the fact that MAMP uses it's own .ini file and seems to ignore the .ini file in it's own PHP conf folder.

Once i updated MAMP's own .ini file (stored in /Applications/MAMP etc...).

Check your phpInfo page and look for the following:

Loaded Configuration File:  /Library/Application Support/appsolute/MAMP PRO/conf/php.ini
jamesmhaley
  • 44,484
  • 11
  • 36
  • 49