How to install PHP under Linux

Source: Internet
Author: User
This article mainly describes how to install PHP under Linux, interested in the reference of friends, I hope to be helpful to everyone.

Linux installation php-5.4.5

1. Download the php-5.4.5.tar.gz

2. Unzip

[root@test31~] TAR-ZXVF php-5.4.5.tar.gz

3. Go to the installation file directory

[root@test31~] CD php-5.4.5

4. Implementation

[Root@test31 php-5.4.5]#./configure--prefix=/usr/local/php5--with-apxs2=/usr/local/apache/bin/apxs -- With-mysql

Note: Green flag for your Apache installation directory

A problem occurred:

"configure:error:xml2-config not found. Please check your LIBXML2 installation."

Check if the LIBXM package is installed

[Root@test31 php-5.4.5]# Rpm-qa |grep libxml2
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12

Reinstall the LIBXML2 and Libxml2-devel packages

Yum Install LIBXML2

Yum Install libxml2-devel-y (install this)

Find out if the Xml2-config file exists after installation

[Root@test31 php-5.4.5]# Find/-name "Xml2-config"
/usr/bin/xml2-config

Reinstall PHP if it exists

[Root@test31 php-5.4.5]#./configure--prefix=/usr/local/php5--with-apxs2=/usr/local/apache/bin/apxs -- With-mysql

Execute if error: "cannot find MySQL header files under Yes"

You need to specify the installation path for MySQL

[Root@test31 php-5.4.5]#./configure--prefix=/usr/local/php5--with-apxs2=/usr/local/apache/bin/apxs -- With-mysql=/usr/local/mysql

The successful installation flags are:

Appear

+--------------------------------------------------------------------+
| License: |
| This software was subject to the PHP License, available in this |
| Distribution in the file LICENSE. By continuing this installation |
| Process, you is bound by the terms of this License agreement. |
| If you don't agree with the terms of this license, you must abort |
| The installation process at this point. |
+--------------------------------------------------------------------+

Thank for using PHP.

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.