server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name www.lnmp.org;
index index.html index.htm index.php;
root /home/wwwroot/default;
#error_page 404 /404.html;
#替换include enable-php.conf;
#为
include enable-php-pathinfo.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/access.log;
error_log /home/wwwlogs/error.log error;
}
include vhost/*.conf;
}
重启lnmp会发现nginx会把入口文件替换掉
然后我们在tp3.2.3入口文件定义一个常亮即可
define('_PHP_FILE_',$_SERVER['SCRIPT_NAME']);