Ω Security Update 2012-004 Server (Snow Leopard) is not PHP Neutral
This update is not PHP-neutral. Apple installs PHP 5.3.15 over your custom PHP installation.
I looked at the configure
that Apple uses and it looks about like our usual configure info, save for a few options (see below).
So the steps required to make this all work with what we have from our previous expeditions, except this time I decided to try a 5.4.8 installation, which should keep us ahead of Apple for quite some time:
Keep copies of the Apple binaries and how they configured their installation:
$ php -i > ~/php-config-2012.11.08 $ sudo cp /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.old $ sudo cp /usr/bin/php /usr/bin/php.old
Get the 5.4.8 tarball and unpack it.
Move the libpng headers around a bit so that
configure
doesn’t find old headers for use with the new libraries:$ sudo mv /usr/X11R6/include/png.h /usr/X11R6/include/png.h_old
Append the new flags to the configure statement and configure away:
$ ./configure '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--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-zend-multibyte' '--enable-zip'
(PHP will gripe about ‘—enable-zend-multibyte’ and ‘—disable-dependency-tracking’, but I’ve left them in here so I can go back and investigate. Note that this may cause a problem—I just don’t know yet.)
Use four cores to make PHP. It’s a lot faster to use the
-j 4
option, and if you have more cores, make the number match:$ make -j 4
Install.
$ sudo make install
Restart Apache.
$ sudo apachectl restart
Clean up what we did to the libpng headers:
$ sudo mv /usr/X11R6/include/png.h_old /usr/X11R6/include/png.h
Done.
Alternatively, if you have already installed 5.4.8 before, all you need to do is:
Keep copies of the Apple binaries and how they configured their installation:
$ php -i > ~/php-config-2012.11.08 $ sudo cp /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.old $ sudo cp /usr/bin/php /usr/bin/php.old
Install.
$ sudo make install
Restart Apache.
$ sudo apachectl restart
Done!
Recent Comments