Security Update 2010-005 (Snow Leopard - Server) is not PHP Neutral

|

As is clearly stated, this update is not PHP-neutral. Apple installs PHP 5.3.2 over your custom PHP installation.

I looked at the configure that Apple uses and there are two new flags, '--enable-zend-multibyte' and '--enable-zip'. If you just append these flags to the previous configure statement, all is still not well because there will be a mismatch between the libpng headers and libraries. Finally, Apple’s sticking 5.3.2 out there. Why not use 5.3.3, I say?

So the steps required to make this all work with what we have from our previous expeditions:

  1. Keep copies of the Apple binaries and how they configured their installation:

    $ php -i > ~/php-config-2010.09.03
    $ sudo cp /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.old
    $ sudo cp /usr/bin/php /usr/bin/php.old
    
  2. Get the 5.3.3 tarball and unpack it.

  3. 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
    
  4. 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'
    
  5. 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
    
  6. Install.

    $ sudo make install
    
  7. Restart Apache.

    $ sudo apachectl restart
    
  8. Clean up what we did to the libpng headers:

    $ sudo mv /usr/X11R6/include/png.h_old /usr/X11R6/include/png.h
    

Done.

Recent Comments