Security Update 2011-006 Server (Snow Leopard) is not PHP Neutral
This update is not PHP-neutral. Apple installs PHP 5.3.6 over your custom PHP installation.
I looked at the configure
that Apple uses and it looks about like our usual configure info.
So the steps required to make this all work with what we have from our previous expeditions:
Keep copies of the Apple binaries and how they configured their installation:
$ php -i > ~/php-config-2011.10.20 $ 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.3.8 tarball and unpack it. (5.3.8 seems to be a good drop-in replacement for 5.3.6, which is where I was.)
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'
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.3.8 before, all you need to do is:
Keep copies of the Apple binaries and how they configured their installation:
$ php -i > ~/php-config-2011.10.20 $ 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