1, check whether to install php $ rpm-qa | compiler $ cdphp-5.2.5 after php source package Compilation: $. configure -- prefixusrlocalphp -- with-apxs2usrlocalapachebinap
1. Check whether php $ rpm-qa | grep php has been installed. 2. If yes, delete it first, $ rpm-e php -- nodeps 3, unzip $ tar-zxvf php-5.2.5.tar.gz $ cd php-5.2.5 to compile the php source package: $. /configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache/bin/ap
1. Check whether php has been installed before.
$ Rpm-qa | grep php
2. If it has been installed, delete it first,
$ Rpm-e php -- nodeps
3. Decompress
$ Tar-zxvf php-5.2.5.tar.gz
$ Cd after php-5.2.5
Compile the php source code package:
$./Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache
/Bin/apxs -- with-mysql =/usr/local/mysql
$ Make: generate executable files
$ Make install
Tips: If php is successfully installed, libphp5.so will be generated under apache/modules
Open the apache configuration file (/usr/local/apache/conf/http. conf) and add a line at the end.
AddType application/x-httpd-php. php
Restart apache
$/Usr/local/apache/bin/apachectl restart
Create a php file (/usr/local/apache/htdocs) named test. php and enter the following content
Echo phpinfo ();
?>
Open the browser and test: Enter http: // localhost/test. php
Finally, php. ini-dist in the php-5.2.5 directory
Cp php. ini-dist/usr/local/php/lib/php. ini