Original address: http://blog.njmars.com/myhan/archive/2004/07/17/221.aspx
Below I start installing PHP5, the process is actually very simple.
First, PHP official website download PHP5 source code package: this is the download page: http://www.php.net/downloads.php This is a PHP5 download connection: http://cn.php.net/get/php-5.0 .0.TAR.GZ / FROM / THIS / MIRROR
Unzipped source code package: $ TAR ZXVF PHP-5.0.0.tar.gz $ CD PHP-5.0.0
Start installing: $ ./configure --with-apxs2 = / usr / local / apache2 / bin / apxs --with-openssl = / usr / local / ssl --with-mysql = / usr / local / mysql I am PHP5 is compiled into a Module loaded by Apache, which is specified here that Apache2 is used. If it is apache1, --with-apxs2 needs to be replaced with --with-apxs. If you use ./configure --Help to view help, you can see this prompt: Experimental: build Shared Apache 2.0 Module. File is the optional pathname to the apache apxs Tool; defaults to apxs. This is a module under Apache2 The installation method is still in the experimental phase. I am using MySQL4.0, if you want to use the MySQLI module provided by PHP5, you also need to install version of MySQL4.1. However, the official website of MySQL said this has not officially launched:) $ make $ su # make install
The installation is over here, and some configuration is needed. When Make Install, the LoadModule has been automatically added to the Apache's configuration file httpd.conf, and there are some additional settings below. Reference PHP manual can find these content: http://www.php.net/manual/en/installation.php
First copy the PHP profile from the source directory to the corresponding place, I don't - PREFIX specifies the PHP installation directory, so according to the default setting, prefix is / usr / local, php.ini's location should be: / usr / Local / lib under. How do I see if php.ini works? Tell:) $ mv php.ini-recommented /usr/local/lib/php.ini
Then, edit httpd.conf, add the following instructions to tell Apache to resolve files of a specific extension into PHP. At the same time, I also added index.php as the default page. ## BRING IN Additional Module-Specific Configurations - MOD_PHP5 #
Restart the Apache server, everything is OK, write a phpinfo to see it:
php phpinfo ();?>>