I’ve been trying to build and link libphp5.so using the –enable-embed configure option, on OSX. This doesn’t complete successfully, failing primarily because of object files not being found during the linking stage.
There are reports that the –enable-embed option has been broken on OSX for a long time.
Has anybody had any success doing this, linking and embedding the Zend Engine functions into a C/C++ app?
I finally managed to do this after lots of failed attempts. Here is a configure string that will build the libphp5.a library on OSX for PHP 5.3.6:
Then, when linking to C/C++ code, you need to add libresolv to prevent link errors relating to DNS functions in the Zend Engine. For example:
Hope this helps somebody one day 🙂