首页 > 技术文章 > 手动配置wnmp环境

darktime 2013-11-01 13:24 原文

wamp 是什么?

windows,nginx,mysql,php(当然也可以是PYTHON等)

只所以使用nginx,是因为我等下要配置ZendGuardLoader

ZendGuardLoader只支持非安全线程的PHP

非安全线程的PHP 和APACHE不兼容 所以就选择NGINX

顺便写一篇博客作为总结

下载地址

请产考我上一篇博客,地址:

http://www.cnblogs.com/darktime/p/3400930.html

nginx的下载地址为nginx.org

 

安装细节就不说了,直接说配置

对mysql的要求:

要能启动开即可。

好了下面开始配置,

打开PHP的跟目录找到php.ini-development 复制一份 改名为php.ini 然后打开

开启支持mysql的PHP扩展

extension=php_mysql.dll
extension=php_mysqli.dll

extension=php_pdo_mysql.dll

让PHP与nginx结合

打开cgi.fix_pathinfo=1

enable_dl = On
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1
cgi.rfc2616_headers = 1

 

打开nginx配置文件

找到 root  html; 改成 root E:/www 根目录地址

找到

        # 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;
        #}

 将前面的#号去掉 然后将root  html; 改成 root E:/www

将scripts改成 $document_root ;即为

 fastcgi_param SCRIPT_FILENAME $document_root&fastcgi_script_name

 这里的$document_root就代表上面我们设置的root 后面的地址

启动PHP

启动nginx

就可以访问PHP的文件了

截图一表祝贺

 


 

 

 

推荐阅读