Install php with LAMP

Source: Internet
Author: User
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

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.