Install PHP 5.4.3 under Linux (Apache webserver)

Source: Internet
Author: User

Reprint http://www.cnblogs.com/rainisic/archive/2012/05/23/Apache_PHP_Install.html

Download PHP

Official Download: http://www.php.net/downloads.php

Install PHP

First, make sure that Apache supports the PHP module when compiling the installation, for details please refer to: http://www.cnblogs.com/rainisic/archive/2012/05/23/Linux_Apache2_4_Install.html

Unzip PHP

shell> sudo tar zxvf php-5.4.3.tar.gz/opt/sources

Stop Apache Service

shell> sudo service httpd stop

Configure Install PHP

Shell> cd/opt/sources/php-5.4.3shell> sudo./configure--with-apxs2=/usr/local/apache2/bin/apxs-- with-mysqlshell> sudo makeshell> sudo make install

Configure PHP.ini

shell> sudo cp Php.ini-development/usr/local/lib/php.ini

Edit the httpd.conf file to invoke the PHP module. The path to the right of the LoadModule expression must point to PHP in the system. The make install command above may have done this, but be sure to check it.

LoadModule Php5_module modules/libphp5.so

Tell Apache to parse the specific extension into PHP, for example, let Apache parse the extension. php into PHP. Edit httpd.conf

<filesmatch \.php$>    SetHandler application/x-httpd-php</filesmatch>

Start the Apache service test in the usual way.

Install PHP 5.4.3 under Linux (Apache webserver)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.