免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2482 | 回复: 0
打印 上一主题 下一主题

关于nginx+php5.3.8+eclipse3.7工作空间的配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-11-24 17:22 |只看该作者 |倒序浏览
关于nginx+php5.3.8+eclipse3.7工作空间的配置







导语:以前用eclipse3.6时设置php服务器时完全可以在base url栏填写自己工作空间的目录,然后修改nginx.conf加一个alias就行了。因此可以直接在自己的工作空间运行程序,但当用到eclipse3.7和PDT3.0.2的集成时居然不允许在base url栏填写自己工作空间的目录了,网上查阅包括英文仍无办法,因此只得另想办法。

这个版本的PDT只允许填写不同端口号的base url 的服务器,所以我就在nginx另作一个不同于主端口号的服务端口,把这个端口号的主目录定位到eclipse的工作空间,然后把eclipse的php服务器设置为这个端口号,以后在eclipse工作空间的工程都能自动运行了。

于是修改nginx.conf添加以下几行:
  1.     #eclipse web port:    #        server {        listen       5000;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            root   "C:/Program Files/eclipse-php/workspace";            index  index.html index.htm index.php;        }                        location ~ \.php$ {            root           html;            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  c:/PROGRA~1/eclipse-php/workspace$fastcgi_script_name;            fastcgi_split_path_info     ^(.+\.php)(.*)$;              fastcgi_param  PATH_INFO     $fastcgi_path_info;            include        fastcgi_params;        }    }如果你有ssl设置,可以再添加:

  2.     server {        listen       5443;        server_name  localhost;        ssl                  on;        ssl_certificate      akann.crt;        ssl_certificate_key  akann.key;    #    ssl_session_timeout  5m;    #    ssl_protocols  SSLv2 SSLv3 TLSv1;    #    ssl_ciphers  HIGH:!aNULL:!MD5;    #    ssl_prefer_server_ciphers   on;        location / {            root   "C:/Program Files/eclipse-php/workspace";            index  index.html index.htm index.php;        }        location ~ \.php$ {            root           html;            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  c:/PROGRA~1/eclipse-php/workspace$fastcgi_script_name;            fastcgi_split_path_info     ^(.+\.php)(.*)$;              fastcgi_param  PATH_INFO     $fastcgi_path_info;            fastcgi_param  HTTPS on;            include        fastcgi_params;        }    }这里记住"C:/Program Files/eclipse-php/workspace"和c:/PROGRA~1/eclipse-php/workspace
复制代码
就是你工作空间的目录,我用的是windows,unix目录自行修改。

另外再修改eclipse的php服务器设置:



一切ok.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP