Drupal on Snow Leopard

Drupal 6 probably won't ever work right on PHP 5.3.0, which is what Snow Leopard packs by default. My feeling is that since Ubuntu LTS still runs PHP 5.2, Drupal 7 won't work at production level on PHP 5.3.0 either. For that reason, here is my PHP 5.2.10 install instructions for Snow Leopard. It will trash your built-in Snow Leopard install.

For my own selfish reasons, in case I want 5.3.0 back later, here is the configuration line from phpinfo() in the default install of 5.3.0 in Snow Leopard.

/var/tmp/apache_mod_php/apache_mod_php-53~1/php/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=/BinaryCache/apache_mod_php/apache_mod_php-53~1/Root/usr/local --with-png-dir=/BinaryCache/apache_mod_php/apache_mod_php-53~1/Root/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=/usr

...and to backgrade:

Install the latest JPEG library.
Install latest libmcrypt.
Install MySQL 5.0.

Yes, I realize the database isn't the latest version, but it meshes with Ubuntu LTS for the moment.

./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-apxs2=/usr/sbin/apxs --enable-cli --with-zlib-dir=/usr --enable-mbstring --enable-mbregex --enable-sockets --with-curl=/usr --with-config-file-path=/etc --sysconfdir=/private/etc --with-mysql-sock=/tmp/mysqld.sock --with-pear=/Library/PHP --without-iconv --without-openssl --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --with-mcrypt --with-xmlrpc --with-bz2 --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6 --with-gd --enable-ftp --enable-exif --with-kerberos=/usr --with-iodbc=/usr --enable-bcmath --enable-calendar --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xsl=/usr

Add -lresolv on EXTRA_LIBS in Makefile, or you'll get an error with dns.o right at the end of the compile.

make
sudo make install


» deekayen's blog · Printer-friendly version · Send to friend Topics:

Homebrew is a good solution

I am maintaining PHP 5.2 build scripts for the Homebrew project which is a great light-weight alternative to macports. I have a HOWTO on my blog (http://boztek.net)

reply

Compiling fails

No matter what I seem to do, I can't get it to compile. I get the following error:

Undefined symbols:
  "_iconv_close", referenced from:
      _do_convert in gdkanji.o
      _convert in encodings.o
  "_iconv", referenced from:
      _do_convert in gdkanji.o
      _convert in encodings.o
  "_iconv_open", referenced from:
      _do_convert in gdkanji.o
      _convert in encodings.o
ld: symbol(s) not found

reply

Use macports php52

There is now a port for php 5.2 (php52) which solves this problem (if you're using macports).

reply

Drupal 6.14 supports PHP 5.3

Drupal 6.14 supports PHP 5.3. Although I've not tried it and there are some obvious caveats.

Drupal 6.14 is the first stable release to support PHP 5.3.0, but this might not be true about the contributed modules you are using. Watch out for updates to your contributed modules if you experience problems with PHP 5.3.0 support.

http://drupal.org/drupal-6.14

reply

So Close... but not quite :-{

First of all, thanks much for working thru this and then sharing...

This Mac was upgraded to Snow Leopard last week. I installed Xcode 3.2 by way of a download from ADC earlier today.

I'm getting errors that start like this:

strtod.o Zend/zend_objects.o Zend/zend_object_handlers.o Zend/zend_objects_API.o Zend/zend_default_classes.o Zend/zend_execute.o sapi/apache2handler/mod_php5.o sapi/apache2handler/sapi_apache2.o sapi/apache2handler/apache_config.o sapi/apache2handler/php_functions.o main/internal_functions.o -lexslt -liconv -liodbc -lmysqlclient -lmcrypt -lltdl -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lcurl -lbz2 -lz -lm -lxml2 -lz -licucore -lm -lcurl -lssl -lcrypto -lssl -lcrypto -lz -lz -lxml2 -lz -licucore -lm -lmysqlclient -lz -lm -liodbc -lmysqlclient -lz -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxslt -lxml2 -lz -licucore -lm -lresolv -o libs/libphp5.bundle && cp libs/libphp5.bundle libs/libphp5.so ld: warning: in /usr/local/lib/libfreetype.dylib, file is not of required architecture ld: warning: in /usr/local/lib/libpng.dylib, file is not of required architecture Undefined symbols: "_png_set_PLTE", referenced from: _php_gd_gdImagePngCtxEx in gd_png.o "_FT_Init_FreeType", referenced from: _php_gd_gdFontCacheSetup in gdft.o "_png_set_packing", referenced from: _php_gd_gdImagePngCtxEx in gd_png.o _php_gd_gdImageCreateFromPngCtx in gd_png.o "_png_read_update_info", referenced from: _php_gd_gdImageCreateFromPngCtx in gd_png.o

any suggestions? thanks!

reply

Am I missing something?

Well, it looks like I'm blind, but I dont see the instructions to install PHP 5.2 on Snow Leopard..

reply

command line

That's because they're all commandline. I don't use installers for unix-y programs when there's a perfectly good command line option with Xtools. The little part I left out was downloading the PHP 5.2.10 source package, tar -xzf it, and cd into it before running ./configure.

reply

aha, thanks mate, will give

aha, thanks mate, will give it a shot!

reply

Drupal 6 probably won't ever

Drupal 6 probably won't ever work right on PHP 5.3.0

I'd say the opposite. The work being done in the issue that Zlender linked show that there's clearly a push for making Drupal 6 compatible with PHP 5.3. Most of the comments in that issue agree that Drupal 6 needs to work on the stable and recommended version of PHP. It's not only Snow Leopard, packaged like XAMPP also ships with 5.3 now. I'd guess that this is resolve with the next release of Drupal 6.

reply

I agree with Zlender

I wouldn't pronounce that Drupal 6 will never be PHP 5.3 compatible when there is active work on a patch to fix. I normally jump at the opportunity to update to the latest version of OS X. This time I'm waiting a month or so to ensure kinks like this one have all been worked out.

reply

Not really that active

The issue is 8 months old. There's such a thing as letting the issue go stale by ignoring it. Stable releases generally only get security fixes. Bugfixes go in the next version (now D7, which that patch did committed to).

That's not really the point though. As long as various LTS linux distros are running 5.2, there's going to be a huge contrib pool that only supports 5.2 and nobody can run a decent size site with real users without significant reliance on contrib. Since a lot of modules only get attention during an upgrade between core versions, the next round of contrib updates that is likely to deal with PHP 5.3.x is Drupal 8 - probably over a year away. That's part of why I'm ok with trashing my 5.3.0 SL install of PHP. I'll probably be on the next release of Mac OS before 5.3.0 is accepted by enough of Drupal users to matter.

reply

I just apply patch from

I just apply patch from http://drupal.org/node/360605 to every D6 co I do and it works fine.

reply

Hacking core stinks

I don't run hacked up versions of core in production and I don't recommend anyone else doing so either.

reply

I completely agree - it's

I completely agree - it's definitely not advisable to run hacked versions of the core which is essential to overall function. The above poster should be careful next time before mentioning possibly dangerous suggestions. And don't you think it might be inadvisable to 'trash' the install of Snow Leopard? Finally, wbj, I am getting similar errors as well... since I am no expert, just a lowly handyman, does anyone have any advice for this? Namely the following:

strtod.o Zend/zend_objects.o Zend/zend_object_handlers.o Zend/zend_objects_API.o Zend/zend_default_classes.o Zend/zend_execute.o sapi/apache2handler/mod_php5.o sapi/apache2handler/sapi_apache2.o sapi/apache2handler/apache_config.o sapi/apache2handler/php_functions.o main/internal_functions.o -lexslt -liconv -liodbc -lmysqlclient -lmcrypt -lltdl -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lcurl -lbz2 -lz -lm -lxml2 -lz -licucore -lm -lcurl -lssl -lcrypto -lssl -lcrypto -lz -lz -lxml2 -lz -licucore -lm -lmysqlclient -lz -lm -liodbc -lmysqlclient -lz -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxslt -lxml2 -lz -licucore -lm -lresolv -o libs/libphp5.bundle && cp libs/libphp5.bundle libs/libphp5.so ld: warning: in /usr/local/lib/libfreetype.dylib, file is not of required architecture ld: warning: in /usr/local/lib/libpng.dylib, file is not of required architecture Undefined symbols: "_png_set_PLTE", referenced from: _php_gd_gdImagePngCtxEx in gd_png.o "_FT_Init_FreeType", referenced from: _php_gd_gdFontCacheSetup in gdft.o "_png_set_packing", referenced from: _php_gd_gdImagePngCtxEx in gd_png.o _php_gd_gdImageCreateFromPngCtx in gd_png.o "_png_read_update_info", referenced from: _php_gd_gdImageCreateFromPngCtx in gd_png.o

Best Wishes,

Tim Clarence, husband & Drupal geek! Homepage: http://www.lawn-sweeper.info

reply

I completely agree with you.

I completely agree with you. No way I'm running this patch on production servers. But then again I don't run PHP 5.3 on production either.

reply

Post new comment

  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <hr /> <a> <p> <em> <strong> <cite> <code> <blockquote> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.