In Centos, PHP lacks a library solution (this method is more violent and is not a last resort. do not imitate it !) _ PHP Tutorial

Source: Internet
Author: User
In Centos, PHP lacks a library solution (this method is more violent and is not a last resort. do not imitate it !). In Centos, PHP lacks a library solution (this method is more violent and is not a last resort. do not imitate it !) Problem cause: If the extensions that are often used to install PHP are not complete, it is easy to find a solution to the lack of PHP library in Centos (this method is more violent, not a last resort, please do not imitate it !)
Problem: If PHP is often installed with incomplete extensions, it is easy to see the lack of extensions. if you want to use yum to add extensions for a long time, you will have a dependency problem and cannot install them, in this case, you can only try to pass the software package. /configure; make install; a series of commands are installed, but the installation may take the lead at the end, telling you that the installation failed! So here is a more violent method, that is, completely uninstall PHP and re-install yum !!!
Next we will teach you how to fully uninstall the package, and use the following command to check which php-related installation packages are available.
Rpm-qa | grep php // If you paste the previous command, you can press it.
The following installation packages are displayed:
Php-common-5.4.36-1.el6.remi.i686
Php-xml-5.4.36-1.el6.remi.i686
Php-pecl-apc-3.1.15-0.4.20130912.el6.remi.5.4.i686
Php-fpm-5.4.36-1.el6.remi.i686
Php-mysql-5.4.36-1.el6.remi.i686
Php-pear-1.9.5-3.el6.remi.noarch
Mod-php-5.4-apache2-zend-server-5.4.34-17.i386
Php-5.5-bin-zend-server-5.5.13-16.i386
Php-bcmath-5.4.36-1.el6.remi.i686
Php-pdo-5.4.36-1.el6.remi.i686
Php-gd-5.4.36-1.el6.remi.i686
Php-dba-5.4.36-1.el6.remi.i686
Php-process-5.4.36-1.el6.remi.i686
Okay, we can unmount it one by one...
Sudo rpm -- nodeps-e (software package name) // uninstall it.
...
...
This time, we can reinstall it easily.
Sudo yum -- enablerepo = remi install php-fpm php-mysql php-cli php-gd php-mcrypt php-xml php-dba php-pecl-apc // you have to do whatever you want. add
To view the complete list of available PHP modules during installation, run:
$ Sudo yum -- enablerepo = remi search php-

Do you think this is the end? Apparently not, you need to start the PHP-FPM service
$ Sudo chkconfig php-fpm on
$ Sudo service php-fpm start

Configure PHP

Next, let's make custom settings for the PHP configuration file/etc/php. ini. More specifically, add the following two lines in the/etc/php. ini file.
Cgi. fix_pathinfo = 0
Date. timezone = "PRC"


Warning (this method is more violent than a last resort. do not imitate it !) Problem cause: If the extensions that are often used to install PHP are not complete, it is easy to see missing...

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.