您的位置:首页 > 运维架构 > Nginx

nginx php 配置

2014-01-14 16:01 309 查看
nginx php 环境的搭建步骤:

1.nginx 配置:

server {

listen 4446;

server_name localhost;

location / {

root C:/htdocs/first/public/;

index index.php index.htm ;

}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.php$ {

root C:/htdocs/first/public/;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$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;

}

}

2. php.ini 文件的配置

;cgi.fix_pathinfo=1去掉;

3.启动 php-cgi.exe

使用php-cgi.exe -b 127.0.0.1:9000

以上就是配置文件的设置。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: