Install php5.4 on ubuntu

Source: Internet
Author: User
Mysql and apache have been installed successfully on ubuntu, but apache does not support php yet, this time, we are going to install php on ubuntu and integrate it with apache. 1. for ubuntu to install php, we need to install libxml2 first and execute the following command sudoapt-getinstalll.

Mysql and apache have been successfully installed on ubuntu, but apache does not support php. this time, we are going to install php on ubuntu and integrate it with apache.

1. for ubuntu to install php, you need to install libxml2 first.

Run the following command first

Sudo apt-get install libxml2
Sudo apt-get install libxml2-dev

2.decompress the PHP tar.gz package

3. compile php

Enter the php extract directory and enter. /configure -- prefix =/usr/local/php -- with-apxs2 =/home/cry/apache/bin/apxs -- with-mysql =/usr/local/mysql -- with-config- file-path =/usr/local/php -- enable-mbstring

The above -- with-config-file-path =/usr/local/php can also not, look at the actual situation to get the line, the with-apxs2 configuration is apache bin directory under the apxs

After compiling php, you should see the following interface:

4. generate an executable file

Just use the make command like installing other software.

This process may take several minutes. during this time, you can have a cup of tea.

5. install php

6. copy the php. ini-development in the compilation directory to the php installation directory.

If the with-config-file-path is not configured, copy the file to the lib folder in the php installation directory.

7. modify httpd. conf of apache

Add AddType application/x-httpd-php. php to the bottom of LoadModule.

8. write a php test environment in apache htdocs to check whether the environment is successfully set up.

 Normally, you should see such a page

 

Related Article

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.