Blogger Information
Blog 2
fans 0
comment 0
visits 2008
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
ubuntu配置nginx+php
Justliveonce的博客
Original
904 people have browsed it

网上关于如何设置nginx配置的location太多了,基本没毛病,略微有些老

首先配置对于php文件的处理,最新的nginx只需在配置文件中把

 location ~ \.php$ {

                include snippets/fastcgi-php.conf;

        #

        #       # With php7.0-cgi alone:

        #       fastcgi_pass 127.0.0.1:9000;

        #       # With php7.0-fpm:

                fastcgi_pass unix:/run/php/php7.0-fpm.sock;

        }

去掉几个#号即可,这里注意fastcgi_pass路径设置成自己的php-fpm.sock的所在路径。

我这里要提醒的一个‘坑’

这些配置全部都写好了,一点毛病没有,可是我的测试文件a.php里面的phpinfo();就是死活不显示,怎么修改各种配置都是空白。折腾了半天,最后发现问题所在,简直气死。因为a.php文件的开头<?php我写成了<? php多了一个空格。。。此处省略一万字,去掉空格问题解决,坑爹啊



Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post