Home >Operation and Maintenance >Linux Operation and Maintenance >Linux php 5.4 installation tutorial

Linux php 5.4 installation tutorial

藏色散人
藏色散人Original
2020-08-01 09:19:514484browse

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.

Linux php 5.4 installation tutorial

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn