簡介:這是nginx,php for window 7(64bit) install的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=340857' scrolling='no'>
最近裝了WIN7 64位系統.以前的環境都用不了鳥,重新配環境,做個筆記
下載NGINX,PHP (NGINX32位湊合用)
php for window 64bit url: 如果你ECLIPSE用64位的千萬記得要下64位的PHP,否則DEBUG用不鳥的
http://windows.php.net/downloads/qa/archives/
下載XDEBUG的時候記得下載TS版,否則也出現載入失敗,zend debug自動無64位的
PHP 5.3 VC9 TS (64 bit)
XDEBUG:
http://xdebug.org/download.php
PHP.ini配置:
#有些PHP擴充在64位下沒有對於的DLL庫,比如SOCKETS,誰有的給我發個,其他的根據自己的需要配置,以下位XDEBUG配置
zend_extension="F:/Web Server/php-5.3.1/ext/php_xdebug-2.1.1-5.3-vc9-x86_64.dll"
xdebug.remote_autostart=true
xdebug.remote_enable=true
xdebug.remote_port=16000
xdebug.profiler_enable=true
xdebug.profiler_output_dir="F:/Web Server/Web Temp"
雖然是ts版但zend_extension 不能用 zend_extension_ts,否則PHP會載入不到該擴充
修改Eclipse的xdebug的連接埠監聽為16000
選中show super globals in varibable view,Accept remote session(JIT)位any (意思是監聽本地地址的16000連接埠)
還有需要添加一個PHP擴充到ECLIPSE等操作,略
安裝APTANA,把組勾選取消,只選擇aptana core 和aptana plugin 其他不裝
pdt運行DEBUG的時候常會出現路徑錯誤現象,導致DEBUG不能運行,納悶~
對於eclipse 3.7蛋疼的中文字型,可以用
http://files.xiaogui.org/eclipse-indigo/YaHei.Consolas.1.12.rar
這個字型
編寫啟動指令碼:
安裝MYSQL的時候不要安裝服務,因為在WIN7下啟動服務的指令碼需要管理員權限,麻煩
@echo off
:memu
cls
echo 1.啟動web
echo 2.關閉web
echo 3.退出
set /p s="請選擇:"
if "%s%"=="1" goto start
if "%s%"=="2" goto stop
if "%s%"=="3" exit
:start
echo 啟動NGINX
f:
cd "F:/Web Server/nginx-1.0.5/"
start nginx.exe
echo 啟動PHP
"F:/Web Server/RunHiddenConsole.exe" "F:/Web Server/php-5.3.1/php-cgi.exe" -b 127.0.0.1:9000 -c "F:/Web Server/php-5.3.1/php.ini"
echo 啟動MYSQL
"F:/Web Server/RunHiddenConsole.exe" "F:/Web Server/MySQL Server 5.5/bin/mysqld.exe"
echo 啟動完畢
pause
goto memu
:stop
echo 關閉nginx
taskkill /F /IM nginx.exe > nul
echo 關閉PHP
taskkill /F /IM php-cgi.exe > nul
echo 關閉MYSQL
taskkill /F /IM mysqld.exe > nul
echo 關閉完畢
pause
goto memu
附上RunHiddenConsole.exe(隱藏CMD用的小工具)
修改NGINX的設定檔,加虛擬機器主機,PHP等,PHPMYADMIN可以建立一個虛擬機器主機上,好像別名放到ROOT以為的目錄不行,報沒有許可權錯誤
1 server {
2 listen 8080;
3 server_name localhost;
4
5 #charset koi8-r;
6
7 #access_log logs/host.access.log main;
8
9 location / {
10 root D:/Users/Webdoc/other;
11 index index.php index.html index.htm;
12 }
13
14 #error_page 404 /404.html;
15
16 # redirect server error pages to the static page /50x.html
17 #
18 error_page 500 502 503 504 /50x.html;
19 location = /50x.html {
20 root html;
21 }
22
23 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
24 #
25 #location ~ \.php$ {
26 # proxy_pass http://127.0.0.1;
27 #}
28
29 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
30 #
31 location ~ \.php$ {
32 root D:/Users/Webdoc/other;
33 fastcgi_pass 127.0.0.1:9000;
34 fastcgi_index index.php;
35 fastcgi_param SCRIPT_FILENAME D:/Users/Webdoc/other$fastcgi_script_name;
36 include fastcgi_params;
37 }
38
39 # deny access to .htaccess files, if Apache's document root
40 # concurs with nginx's one
41 #
42 #location ~ /\.ht {
43 # deny all;
44 #}
45 }
46
47 server {
48 listen 80;
49 server_name localhost;
50
51 #charset koi8-r;
52
53 #access_log logs/host.access.log main;
54
55 location / {
56 root D:/Users/Webdoc/web;
57 index index.php index.html index.htm;
58 }
59
60 #error_page 404 /404.html;
61
62 # redirect server error pages to the static page /50x.html
63 #
64 error_page 500 502 503 504 /50x.html;
65 location = /50x.html {
66 root html;
67 }
68
69 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
70 #
71 #location ~ \.php$ {
72 # proxy_pass http://127.0.0.1;
73 #}
74
75 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
76 #
77 location ~ \.php$ {
78 root D:/Users/Webdoc/web;
79 fastcgi_pass 127.0.0.1:9000;
80 fastcgi_index index.php;
81 fastcgi_param SCRIPT_FILENAME D:/Users/Webdoc/web$fastcgi_script_name;
82 include fastcgi_params;
83 }
84
85 # deny access to .htaccess files, if Apache's document root
86 # concurs with nginx's one
87 #
88 #location ~ /\.ht {
89 # deny all;
90 #}
91 }
增加兩個主機,注意紅色部分
愛J2EE關注Java邁克爾傑克遜視頻站JSON線上工具
http://biancheng.dnbcw.info/php/340857.html pageNo:7