yoink@tumblr ~ % less 1138770000.txt
Getting MySQL5 to play nice with PHP5
I’ve been trying to get my fresh install of Tiger up and running and decided to take a crack at MySQL5 and the latest PHP5. So I grabbed the handy package from MySQL AB and installed MySQL and the included startup item and preference pane. Easy, same as with their earlier packages.
Then I grabbed the latest PHP source (5.1.2) and set out to find the perfect configure options. I wasn’t interested in having everything on, but I thought it would be cool to get as much working with what I already had installed as possible. Here’s what I wound up with:
./configure —prefix=/usr/local —program-suffix=5 —enable-fastcgi —enable-force-cgi-redirect —with-openssl —with-kerberos —with-zlib —with-curl —with-ldap —with-xsl —with-pgsql —with-pdo-pgsql —with-mysql=/usr/local/mysql —with-mysqli=/usr/local/mysql/bin/mysql_config —with-pdo=shared —with-pdo-mysql=/usr/local/mysql —with-pdo-sqlite —enable-sqlite-utf —enable-bcmath —enable-exif —enable-soap —enable-dba —with-db4=/opt/local —enable-ftp
This includes native Tiger supported features, PostgreSQL, MySQL5 and FastCGI, some of which I installed through Darwinports.
Update: It works fine now with all the latest sources, with no manipulation neccessary. Weird. I’ll leave the rest for history sake.
Okay, so maybe it’s not that minimal, but it didn’t work anyway. The process kept coming to a halt when checking support for MySQLi. The configure script couldn’t seem to find the MySQL shared libraries. MySQL was running, I installed it alright, but as I found out the [MySQL AB OSX package was missing the headers needed to compile MySQLi](http://us2.php.net/manual/en/ref.mysqli.php#60654 properly). So I had to compile them myself. If you’re trying to compile PHP5 with the MySQL AB binary package and getting a MySQL’s missing error try the following:
- Grab the MySQL5 source package
- Open it up and run
./configure --prefix=/usr/local --enable-shared - Compile it, but don’t install it.
make - Copy the libraries to the MySQL directory.
cp libmysql/.libs/libmysqlclient.15.0.0dylib /usr/local/mysql/lib/ - Make some symlinks.
ln -s /usr/local/mysql/lib/libmysqlclient.15.0.0dylib /usr/local/mysql/lib/libmysqlclient.15.dylib ln -s /usr/local/mysql/lib/libmysqlclient.15.0.0dylib /usr/local/mysql/lib/libmysqlclient.dylib - Retry compiling PHP5.
Thanks to the original poster, and I hope it helps more people.