关于nginx+php5.3.8+eclipse3.7工作空间的配置方法

2025-05-26 0 48

因此可以直接在自己的工作空间运行程序,但当用到eclipse3.7和PDT3.0.2的集成时居然不允许在base url栏填写自己工作空间的目录了,网上查阅包括英文仍无办法,因此只得另想办法。

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

于是修改nginx.conf添加以下几行:

复制代码代码如下:


#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设置,可以再添加:

复制代码代码如下:


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服务器设置:

关于nginx+php5.3.8+eclipse3.7工作空间的配置方法
一切ok.

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

快网idc优惠网 建站教程 关于nginx+php5.3.8+eclipse3.7工作空间的配置方法 https://www.kuaiidc.com/53785.html

相关文章

发表评论
暂无评论