No64:Centos7部署PHP项目
|字数总计:137|阅读时长:1分钟|阅读量:10
本文于 1326 天之前发表,文中内容可能已经过时。
一、CentOS7用Yum方式安装php-fpm
# PHP5.4 yum -y install php php-fpm php-gd php-mysql php-common php-pear php-mbstring php-mcrypt
# 启动服务 systemctl start php-fpm
# 停止服务 systemctl stop php-fpm
# 重启服务 systemctl restart php-fpm
# 服务状态 systemctl status php-fpm
# 开机启动 systemctl enable php-fpm
|
二、配置NGINX
server { listen 80; server_name 127.0.0.1; root /www/wwwroot; index index.php index.html index.htm; location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
|
三、重启NGINX,公网访问
通过127.0.0.1:80访问PHP网站。