關于nginx+php5.3.8+eclipse3.7工作空間的配置方法
更新時間:2011年11月25日 00:40:31 作者:
以前用eclipse3.6時設置php服務器時完全可以在base url欄填寫自己工作空間的目錄,然后修改nginx.conf加一個alias就行了
因此可以直接在自己的工作空間運行程序,但當用到eclipse3.7和PDT3.0.2的集成時居然不允許在base url欄填寫自己工作空間的目錄了,網(wǎng)上查閱包括英文仍無辦法,因此只得另想辦法。
這個版本的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服務器設置:
這個版本的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服務器設置:
一切ok.
您可能感興趣的文章:
- myeclipse安裝Spring Tool Suite(STS)插件的方法步驟
- Myeclipse鏈接Oracle等數(shù)據(jù)庫時lo exception: The Network Adapter could not establish the connection
- MyEclipse2018中安裝Mybatis generator插件的實現(xiàn)步驟
- 解決MyEclipse中Maven設置jdk版本jdk1.8報錯問題
- JAVA環(huán)境搭建之MyEclipse10+jdk1.8+tomcat8環(huán)境搭建詳解
- 解決MyEclipse出現(xiàn)the user operation is waiting的問題
- MyEclipse如何取消默認工作空間方法示例
相關文章
Nginx之Http模塊系列之a(chǎn)utoindex模塊的具體使用
這篇文章主要介紹了Nginx之Http模塊系列之a(chǎn)utoindex模塊的具體使用,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2021-03-03nginx connect() to unix:/var/run/php-fpm.sock failed (11: Re
這篇文章主要介紹了nginx connect() to unix:/var/run/php-fpm.sock failed (11: Resource temporarily unavailable),需要的朋友可以參考下2015-01-01PHP的Symfony和CodeIgniter框架的Nginx重寫規(guī)則配置
這篇文章主要介紹了PHP的Symfony和CodeIgniter框架的Nginx重寫規(guī)則配置,文中截取配置中關鍵的一些rewrite寫法進行講解,需要的朋友可以參考下2016-01-01實現(xiàn)Nginx中使用PHP-FPM時記錄PHP錯誤日志的配置方法
最近在本地搭建的LNMP的開發(fā)環(huán)境。為了開發(fā)的時候不影響前端的正常開發(fā)就屏蔽的PHP里面php.ini中的一些錯誤提示。但是這樣一來,就影響到了后端開發(fā)的一些問題比如不能及時調試開發(fā)中的一些問題2014-05-05