Compiling a Custom PHP Build in Mac OS X 10.9 or 10.10
Get Xcode. Install. Run. Download per the usual. Configure fails. /usr/include no longer exists. It’s moved into sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /usr/include ./configure fails again /usr/local also no longer exists
libjpeg
First, grab the libjpeg tarball from its source. Then extract it and throw it into your Installed directory or wherever you’re keeping all this stuff, and it’s important to keep it because as often as Apple wrecks custom PHP installations, you are going to have to do it all again someday.
Things have gotten a bit easier since I did this last time, about five years ago, and all you have to do is the standard configure/make/make install with one option, like this:
$ ./configure -enableshared
8< snip!
$ make 8< snip!
$ sudo make install All we have to do now is keep in mind that libjpeg is now located in /usr/local/lib according to make and can edit the flag appropriately.
‘—with-jpeg-dir=/usr/local’
libpng
Again, grab the source for libpng from its source and unpack it. Let’s see if anything’s changed since I last did this with v1.2.8.
$ ./configure $ make $ sudo make install $ ./pngtest pngtest.png which should produce a bunch of lines with r’s and w’s. If it does, then, Yay! Continue onward.
The libraries end up in /usr/local/lib, just like libjpeg, so its options look similar:
‘—with-png-dir=/usr/local’
./configure fails in the middle with this message: Failed to connect (primarytextfield_cell) outlet from (AppDelegate) to (NSTextFieldCell): missing setter or instance variable
which yields this message on your display (so this required VNC to the machine—not just terminal)
(screenshot)
Note that what it’s telling us is that it can’t find the headers (.h) files for X11, so they can’t be used to link PHP against.
install XQuartz
http://xquartz.macosforge.org/landing/
Do installation as required. Seems to replace Apple’s /usr/X11 with /opt/X11.
MySQL
Adds .h files, PHP now configures with
./configure ‘—prefix=/usr’ ‘—mandir=/usr/share/man’ ‘—infodir=/usr/share/info’ ‘—sysconfdir=/private/etc’ ‘—with-apxs2=/usr/sbin/apxs’ ‘—enable-cli’ ‘—with-config-file-path=/etc’ ‘—with-libxml-dir=/usr’ ‘—with-openssl=/usr’ ‘—with-kerberos=/usr’ ‘—with-zlib=/usr’ ‘—enable-bcmath’ ‘—with-bz2=/usr’ ‘—enable-calendar’ ‘—with-curl=/usr’ ‘—enable-exif’ ‘—enable-ftp’ ‘—with-gd’ ‘—with-jpeg-dir=/usr/local’ ‘—with-png-dir=/usr/local’ ‘—enable-gd-native-ttf’ ‘—with-ldap=/usr’ ‘—with-ldap-sasl=/usr’ ‘—enable-mbstring’ ‘—enable-mbregex’ ‘—with-mysql=mysqlnd’ ‘—with-mysqli=mysqlnd’ ‘—with-pdo-mysql=mysqlnd’ ‘—with-mysql-sock=/var/mysql/mysql.sock’ ‘—with-iodbc=/usr’ ‘—enable-shmop’ ‘—with-snmp=/usr’ ‘—enable-soap’ ‘—enable-sockets’ ‘—enable-sysvmsg’ ‘—enable-sysvsem’ ‘—enable-sysvshm’ ‘—with-xmlrpc’ ‘—with-iconv-dir=/usr’ ‘—with-xsl=/usr’ ‘—with-pcre-regex’ ‘—with-freetype-dir=/usr/X11R6’ ‘—enable-zip’
Recent Comments