服务器环境搭建——CentOS7-安装PHP

安装PHP

由于Centos 7提供的PHP版本与需求不一致,需要配置第三方yum源
1
2
3
4
shell# wget https://mirror.webtatic.com/yum/el7/epel-release.rpm
shell# wget https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
shell# rpm -ivh epel-release.rpm
shell# rpm -ivh webtatic-release.rpm
安装PHP及一些需要的扩张
1
shell# yum install php56w php56w-mysqlnd php56w-gd php56w-mbstring

PHP配置

1
2
#/etc/php.ini
date.timezone = Asia/Shanghai