swanwish / blog

My blog website
0 stars 0 forks source link

Install php7 on centos #43

Open swanwish opened 7 years ago

swanwish commented 7 years ago

Remove old php

yum remove php-fpm php-cli php-common php-mysql

Update rpm repository

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Install php7.0

yum install php70w
yum install php70w-fpm
yum install php70w-mysqlnd

Install php7.1

yum install php71w
yum install php71w-fpm
yum install php71w-mysqlnd

Restart php-fpm service

systemctl restart php-fpm
swanwish commented 7 years ago

Failed! GD Graphic library not enabled. Graph rendering requires it. This feature will be disabled. It's recommended to install it..

yum install php71w-gd
swanwish commented 6 years ago

In my CentOS server, when I try to run php command, it report the following error:

/usr/bin/env: php: No such file or directory

The following package resolve the problem:

yum install php71w-cli