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.