首页 / PHP / windowsnginx+php配备
windowsnginx+php配备
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了windowsnginx+php配备,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1727字,纯文字阅读大概需要3分钟。
内容图文
windows nginx +php 配置在windows下进行nginx +php的配置比较简单:
1、首先下载安装php,版本至少要在5.0以上(主要是要PHP版本支持FastCgi方式,包含有php-cgi.exe即可 ),修改php.ini配置文件
enable_dl = On
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1
cgi.rfc2616_headers = 1
rror_reporting = E_ALL
display_errors = On
extension_dir = "C:\php\ext"
; 动态扩展,可以根据需要去掉 extension 前面的注释 ;?
; 如加载 PDO, MySQL
extension=php_pdo.dll
extension=php_pdo_mysql.dll
2、Nginx配置PHP是以FastCgi方式配置的
3、用文本编辑功能根据打开E:\nginx1.0\conf 目录下的nginx.conf,找到
?? ? ? ?location / {
?? ? ? ? ? ?root ??html;
?? ? ? ? ? ?index ?index.html index.htm;
?? ? ? ?}
修改为
?? ? ? ?location / {
?? ? ? ? ? ?root ??D:/PHPWeb;
?? ? ? ? ? ?index ?index.php index.html index.htm;
?? ? ? ?}
找到
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
?? ? ? ?#
?? ? ? ?#location ~ \.php$ {
?? ? ? ?# ? ?root ? ? ? ? ? html;
?? ? ? ?# ? ?fastcgi_pass ? 127.0.0.1:9000;
?? ? ? ?# ? ?fastcgi_index ?index.php;
?? ? ? ?# ? ?fastcgi_param ?SCRIPT_FILENAME ?/scripts$fastcgi_script_name;
?? ? ? ?# ? ?include ? ? ? ?fastcgi_params;
?? ? ? ?#}
修改为
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
?? ? ? ?#
?? ? ? ?location ~ \.php$ {
?? ? ? ?# ? ?root ? ? ? ? ? html;
?? ? ? ? ? ?fastcgi_pass ? 127.0.0.1:9000;
?? ? ? ? ? ?fastcgi_index ?index.php;
?? ? ? ? ? fastcgi_param ?SCRIPT_FILENAME? D:/PHPWeb$fastcgi_script_name;
?? ? ? ? ? ?include ? ? ? ?fastcgi_params;
?? ? ? ?}
4、启动fast-cgi
?找到php的安装目录,在控制台输入以下命令
f:/php/php-cgi.exe -b 127.0.0.1:9000 -c f:/php/php.ini
5、找到nginx的安装目录,启动nginx
或者建立batlogin"> 您还没有登录,请您登录后再发表评论
内容总结
以上是互联网集市为您收集整理的windowsnginx+php配备全部内容,希望文章能够帮你解决windowsnginx+php配备所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。