There are several conditions that need to be met before installing the PHP software. As follows:
1, RPM-IVH zlib-devel-1.2.3-3.i386.rpm
2, Rpm-ivh libxml2-devel-2.6.26-2.1.2.8.i386.rpm
(The above two packages are in the server directory of the RHEL5.5 installation CD-ROM)
Next, we're going to install PHP.
Note that my MySQL is the RPM package installed, MySQL header file is mysql.h, it is located in the/usr/include/mysql/directory. Also, when installing MySQL, you should install three files, one server, one client, and one devel. The header file mysql.h can only be found after Devel has been installed.
#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/include/mysql/
#make
#make Install
#make Test
Configuring the php.ini File
Because I use this version of php-5.3.8.tar.gz, it will have two files php.ini-development,php.ini-production after decompression.
Copy the Php.ini-development file to the PHP installation directory under/usr/local/php/lib and modify the file name to PHP.ini
Configure the Apache httpd.conf file after installation
in which to join
LoadModule php5_module modules/libphp5.so//This module is automatically written to the httpd.conf file when PHP is installed.
AddType application/x-httpd-php. PHP//This need to be manually added
DirectoryIndex index.html Index.html.var index.php
As for if the PHP program is running
Put the PHP program under Htdocs under Apache.
The final reboot of Apache is complete.