2021-11-12 a minute 0.2 k
Centos 7.X use yum to install-php5.6.X
- Check now php package
1
| yum list installed | grep php
|
- 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
|
- 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
|
- Configure remi source
1
| rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
|
- 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
|
- install php-fpm
1
| yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
|
- Configure boot service
1 2
| systemctl restart php-fpm systemctl enable php-frm
|
- Check if the installation is successful
1 2
| ps -ef | grep php netstat -anp | grep 9000
|
- restar service
1 2 3
| sudo systemctl restart httpd sudo systemctl restart php-fpm service httpd restart
|