Install php in Linux

Source: Internet
Author: User
Install libxml2 in php in Linux

Download decompressed libxml2-2.6.32.tar.gz

Install

./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/libxml2

Install php

Download http://www.php.net/downloads.php
Unzip tar-zxvf php-5.3.16.tar.gz

Install

./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/libxml2 --with-apxs2=/usr/local/httpd/bin/apxsmakesudo make install

There is a-with-apxs2 =/usr/local/httpd/bin/apxs option, where apxs is generated when Apache is installed, apxs is a tool for compiling and installing extension modules for the Apache HTTP Server. it can be loaded to the Apache server at runtime using the LoadModule command provided by mod_so. Use this tool to dynamically load the PHP module into Apache


Copy configuration file

cp ~/php-5.3.16/php.ini-development  /usr/local/php/lib/php.ini

Modify the apache configuration file

Edit the/usr/local/httpd/conf/httpd. conf file.
Find:
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add:

AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .php5 

Find:


DirectoryIndex index.html

Add:

DirectoryIndex index.html index. php

Restart apache

sudo apachectl restart

Verify

Create the info. php file in/usr/local/httpd/php/htdocs.

 

Enter ip/info. php in the browser and observe the following content, indicating that the installation is successful.

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.