PHP, mysqli, Solaris 10 and how not to cause yourself pain...
By fintanr on Jul 04, 2005
Its been quite some time since I've had a reason to handroll a php module (well actually its been quite some time since I've used php, but thats a different matter). Anyway I spent some time last week with a customer who is deploying a apache/mysql/php app on some v20z's running Solaris 10. Now they are very recent converts to Solaris, and the app has been in development for six or seven months, and as such it was developed on a Linux box, with very regular revs of php and mysql. So in order to make the overall migration as easy as possible it was decided to use the same version numbers of the various components on Solaris as on the Linux box, giving us Apache 1.3.33, Mysql 4.1.12 and PHP 5.0.4. So we went forth and got the source, and started to compile, and things went south in a very self inflicted manner. Basically due to not reading up on the latest versions of php and mysql on my part we ended up doing a bunch of unneccesserary compiles, and a php module which had no interest in linking to anything, Anyway as I said this was self inflicted, and the correct (and easiest) thing to do on Solaris 10 is the following.
- Download the MySQL 4.1.12 package for s10 on amd64 from the mysql site.
This will just make your life easier in the long run.
- Grab your php 5.0.4 Source
- Pkgadd the mysql package (pkgadd -d unarchived-pkg)
In our case we symlinked it to /usr/mysql
- Use the bundled apache software (do a pkginfo -l SUNWapchr to confirm the version info)
- Compile php (taking note of the mysqli extensions) with
# add /usr/sfw/bin for gcc, /usr/ccs/bin for make # PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin; export PATH ./configure --with-apxs=/usr/apache/bin/apxs \\ --with-mysqli=/usr/mysql/bin/mysql_config \\ --with-mysql=/usr/mysql make; make install