@到vhost 目录下新建文件shop.c.cn.conf
server
{
listen 80;
server_name shop.c.cn;
root /home/wwwroot/project/shop/public;
index index.php index.html index.htm;
location ~ .*\.php$
{
try_files $uri $uri/ /index.php$is_args$query_string;
root /home/wwwroot/project/shop/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
本文详细介绍如何在Nginx服务器上配置PHP运行环境。通过创建一个名为shop.c.cn的虚拟主机配置文件,实现了对PHP文件的支持。配置包括监听端口、指定根目录、设置索引文件及FastCGI参数等。
1653

被折叠的 条评论
为什么被折叠?



