centos7利用yum安装lnmp的教程(linux+nginx+php7.1+mysql5.7)

2019-01-16 22:18:35于海丽

验证php7.1.x和扩展是否安装成功

验证php是否安装成功

php -v

验证对应的扩展是否安装成功

php -m

设置php-fpm并检测php-fpm的运行状态

启动php-fpm

service php-fpm star

检查启动是否成功

service php-fpm status

设置开机自启动

systemctl enable php-fpm.service

检查开机自启动是否设置成功

systemctl list-dependencies | grep php-fpm ps -ef | grep php-fpm

nginx配置如下:

server{ listen 80; server_name youserver; index index.html index.php; root /home/public; #charset koi8-r; #access_log logs/host.access.log main; location / { index index.html index.htm index.php; try_files $uri $uri/ /index.php?$query_string; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ .php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { root /home/public; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/public$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /.ht { deny all; } }

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对易采站长站的支持。

您可能感兴趣的文章:

Nginx服务器的反向代理proxy_pass配置方法讲解nginx 作为反向代理实现负载均衡的例子Nginx作为反向代理时传递客户端IP的设置方法详解nginx配置url重定向-反向代理Nginx反向代理websocket配置实例nginx学习总结五(nginx反向代理)Nginx 反向代理并缓存及缓存清除的方法centos6.5通过yum安装nginxLinux下yum安装nginx教程nginx反向代理进行yum配置的步骤详解