Because the project needs to reduce the php version from 5.4 to, you need to first uninstall the php that comes with CentOS7.0 and then install php5.3. Take the following steps.
Step 1: uninstall php5.4
1. View php version
2. Uninstall php
3. Check whether php is uninstalled.
Php cannot be uninstalled, and there is a corresponding dependency package. So we need to uninstall it.
4. Uninstall the dependency package corresponding to php
The information on the Internet is uninstalled using rpm-e. However, after several attempts, the system prompts that the installation package cannot be found.
# Rpm e php-mysql-5.1.6-27.el5_5.3
# Rpm e php-pdo-5.1.6-27.el5_5.3
# Rpm e php-xml-5.1.6-27.el5_5.3
# Rpm e php-cli-5.1.6-27.el5_5.3
# Rpm e php-gd-5.1.6-27.el5_5.3
# Rpm e php-common-5.1.6-27.el5_5.3
The solution is as follows:
5. Check whether php has been uninstalled again.
Step 2: install php
1. Download php
2. Upload the file to the server and decompress it.
3. Install php
1. Description:
The code is as follows: |
Copy code |
#-Prefix =/usr/php # PHP Installation Path
#-Exec-prefix =/usr/bin # PHP command execution path
#-Sysconfdir =/etc # configuration file storage path
#-With-apxs2 =/usr/sbin/apxs # Apache apxs extension path
#-With-mysql =/var/lib/mysql # mysql path
#-With-mysqli =/usr/bin/mysql_config # mysqli path
#-With-mcrypt # enable the encryption module
|
2. error, error: xml2-config not found.
3. Install php
4. Compile php
5. Error message
The solution is as follows:
6. Compile php
7. Compile test
8. Installation successful
9. Description
If apache does not recognize php, add the following in http. conf:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php. php