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