Wheew. The instructions on php.net just plain sucks. As described on this thread, the MySQL devel package needs to be installed (can download this from MySQL's site). I also found that I have to do "yum install libxml2-devel" as well. In addition to these, the "--with-libdir=lib64" does need to be specified, or you'll get the error "configure: error: Cannot find MySQL header files under /usr".
The whole command I used is:
Code:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/src --with-libdir=lib64
And yeah, my CentOS 5.5 came with "MySQL client programs and shared libraries" but I removed it via yum using the --nodeps option (or it'd complain about how it also need to remove Dovecot). Then downloaded the client, shared libraries, and devel RPM packages from MySQL's site. It's the devel RPM that saves the day but installed the other two just in case.
However, another problem came up. Following instructions
here and adding the following lines to the httpd.conf caused a problem.
LoadModule php5_module modules/libphp5.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
When I tried to start it, it gave me the following. Huh? Another instruction doesn't work?
Code:
[root@test /]# /sbin/service httpd start
Starting httpd: httpd: Syntax error on line 150 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: cannot open shared object file: No such file or directory
[FAILED]