Home >Backend Development >PHP Problem >How to reinstall php on centos
How to reinstall php in centos: first delete all php related directories through the command "rm -rf /usr/local/php..."; then use the source code package to recompile and install php.
Recommended: "PHP Video Tutorial"
Description: The system originally installed php7.1.0 through source code. I have found many ways to completely delete the original PHP on the Internet. When I execute the command php -v, the PHP version information is always there, but the explanation methods are useless. I boldly made the following attempt and successfully recompiled php
find php
find / -name php
rm -rf /usr/local/php rm -rf /usr/local/etc/php ps aux | grep php-fpm kill [进程]At this time, I can no longer see it when I execute php -vConnect Come down and use the source code package to recompile and install PHP normally. Success!
wget http://cn2.php.net/distributions/php-5.6.5.tar.gz tar -xvzf php-5.6.5.tar.gzThe following is the configuration when I compile php
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip
Special instructions:When compiling ./configure...., there are some The error message basically indicates that some services are not installed. Just post the error message to Baidu and use yum to install some services. Until there is no error prompt
// /usr/local/php/bin为php安装目录 export PATH=$PATH:/usr/local/php/bin即可
The above is the detailed content of How to reinstall php on centos. For more information, please follow other related articles on the PHP Chinese website!