How to install php in centos6.8: first check the currently installed PHP package and delete it; then reconfigure the installation package source; then perform the installation through "yum -y install php56w.x86_64"; finally install PHP FPM. Can.
Check the currently installed PHP packages
yum list installed | grep php
If there are PHP packages installed, delete them first, such as:
yum remove php.x86_64 php-cli.x86_64 php-common.x86_64
Configure the installation package source:
# Centos 5.X rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm # CentOs 6.x rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm # CentOs 7.X rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
If you want to delete the package installed above, reinstall it
rpm -qa | grep webstatic rpm -e [上面搜索到的包即可]
Perform the installation
yum -y install php56w.x86_64 yum -y --enablerepo=webtatic install php56w-devel yum -y install php56w-pdo php56w-xml php56w-gd php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-opcache.x86_64
Install PHP FPM
yum -y install php56w-fpm #设置php-fpm开机启动 chkconfig php-fpm on #启动php-fpm /etc/init.d/php-fpm start
Note : If you want to change to php5.5 or 5.4 version, just replace the above 56w with 55w or 54w.
Recommendation: "centos system tutorial"
The above is the detailed content of How to install php on centos6.8. For more information, please follow other related articles on the PHP Chinese website!