Installing PHP

In order to install PHP with MySQL support you first need to install mysql, mysql-lib, mysql-server and mysql-devel. Install instructions for MySql libs.

Also you may need to install libxml2-devel in order to get xml2-config.

yum install libxml2-devel

Finally generate the makefile:

./configure –with-apxs2=/opt/apache/bin/apxs –with-mysql –prefix=/opt/php

And compile PHP:


make test

And install it

make install

And finally install php-mysql

yum install php-mysql

You need to make sure all these lines are found in httpd.conf:

LoadModule php5_module modules/

<Files *.php>

SetOutputFilter PHP

SetInputFilter PHP


AddType application/x-httpd-php .php