linux php5.4 installation method: first download and decompress PHP; then configure and install PHP; then edit the "httpd.conf" file to call the PHP module; finally parse the specific extension into PHP, and Just start the Apache service test.
Recommended: "linux tutorial"
Installing PHP 5.4 under Linux .3 (Using Apache as WebServer)
Download PHP
Official download: http://www.php.net/downloads.php
Install PHP
First, make sure Apache supports the PHP module when compiling and installing;
Decompress PHP
shell> sudo tar zxvf php-5.4.3.tar.gz /opt/sources
Stop the Apache service
shell> sudo service httpd stop
Configure and install PHP
shell> cd /opt/sources/php-5.4.3 shell> sudo ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql shell> sudo make shell> sudo make install
Configure php.ini
shell> sudo cp php.ini-development /usr/local/lib/php.ini
Edit the httpd.conf file to call the PHP module. The path on the right side of the LoadModule expression must point to PHP on your system. The make install command above may already do this, but be sure to check.
LoadModule php5_module modules/libphp5.so
Tell Apache to parse a specific extension into PHP, for example, tell Apache to parse the extension .php into PHP. Edit httpd.conf
<FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>
and start the Apache service test in the usual way.
The above is the detailed content of Linux php 5.4 installation tutorial. For more information, please follow other related articles on the PHP Chinese website!