Centos 7.X use yum to install-php5.6.X

  1. Check now php package
1
yum list installed | grep php
  1. if there have any php, deleate it first.
1
yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64 
  1. Configure EPEL source
1
2
yum install -y epel-release
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  1. Configure remi source
1
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
  1. Install php5.6.x
1
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
  1. install php-fpm
1
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm 
  1. Configure boot service
1
2
systemctl restart php-fpm
systemctl enable php-frm
  1. Check if the installation is successful
1
2
ps -ef | grep php
netstat -anp | grep 9000
  1. restar service
1
2
3
sudo systemctl restart httpd
sudo systemctl restart php-fpm
service httpd restart
Author

Chen Yu

Posted on

2021-11-12

Updated on

2023-11-14

Licensed under


:D 一言句子获取中...