Compiling PHP on Centos
The precompiled PHP binary does not include MySQL support so it must be recompiled from source.
Download the PHP package and untar it
Download the httpd headers
yum install httpd-devel
Configure
./configure –with-mysql=/usr/bin/ –with-libdir=lib64
–with-apxs2 –with-pic –without-aolserver
make
make test
make install
edit http.conf
LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
AddType application/x-httpd-php .php
Alias /php/ "/var/www/html/php/htdocs/"
<Directory "/var/www/html/php/htdocs/">
Options Indexes FollowSymlinks
AllowOverride All
<LimitExcept POST GET>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
ScriptAlias /cgi-php/ "/var/www/html/php/"
<Directory "/var/www/html/php/">
SetEnv LD_LIBRARY_PATH /opt/oracle/product/10.2.0/client_1/lib32
Options +ExecCGI
AllowOverride None
<LimitExcept POST GET>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
Restart the httpd daemon