Centos 7 php运行环境搭建
一、php安装
1:安装rpm源
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
2:安装php
yum install php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-opcache php71w-pdo php71w-xml php71w-ldap php71w-mcrypt
3:启动服务
service php-fpm start
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
4:版本检查
php -v
二、安装nginx(可选)
1:添加yum源
sudo rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2:安装
sudo yum install nginx
3:设置开机启动(可忽略)
sudo systemctl enable nginx
4:启动服务
sudo systemctl start nginx
5:打开防火墙端口
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload
sudo sudo firewall-cmd --list-service
三、安装Apache(可选)
1:安装
yum install httpd
2:设置开机启动(可选)
systemctl enable httpd.service
3:Apache相关操作
systemctl is-enabled httpd.service
systemctl start httpd.service
systemctl restart httpd.service
systemctl stop httpd.service
发表评论
要发表评论,您必须先登录。