Home >Backend Development >PHP Tutorial >Solution to the lack of libraries in PHP in Centos (this method is relatively violent, please do not imitate it unless it is a last resort!)_PHP Tutorial

Solution to the lack of libraries in PHP in Centos (this method is relatively violent, please do not imitate it unless it is a last resort!)_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:10:201094browse

Solution to the lack of libraries in PHP in Centos (this method is relatively violent, please do not imitate it unless it is a last resort!)

Origin of the problem: It is easy if the commonly used extensions when installing PHP are not added. If there is a lack of extensions, if you want to use yum to add extensions after long-term use, dependency problems will occur and you cannot install them. At this time, you can only try to download the software package yourself and install it through a series of commands: ./configure; make; make install; But at the end of the installation, it may give you a slap in the face and tell you that the installation failed! So here is a more violent method, which is to completely uninstall PHP and reinstall it with yum! ! !
The following will teach you how to completely uninstall. Use the following command to check what PHP-related installation packages are available
rpm -qa | grep php //If the past command does not work, just type it by hand
At this time A large number of installation packages below will be 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, after seeing the above, we can uninstall one by one...
sudo rpm --nodeps -e (package name) //Please try your best to uninstall it.
...
...
This time we can easily reinstall it
sudo yum --enablerepo=remi install php php-fpm php-mysql php-cli php-gd php -mcrypt php-xml php-dba php-pecl-apc //Add whatever you want
When installing, if you want to see the complete list of available PHP modules, you can run:
$ sudo yum -- enablerepo=remi search php-

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

Configure PHP

Next, Let's customize the PHP configuration file /etc/php.ini. More specifically, add the following two lines to the /etc/php.ini file.
cgi.fix_pathinfo=0
date.timezone="PRC"


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/936937.htmlTechArticleSolution to the lack of libraries in PHP in Centos (this method is more violent, please do not imitate it unless it is a last resort!) Problem Reason: If you do not add all the commonly used extensions when installing PHP, it is easy to have defects...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn