How to uninstall and install PHP in CentOS7.0

Source: Internet
Author: User
Tags install php

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

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.