nginx,php for window 7(64bit) install
最近装了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扩展在64位下没有对于的DLL库,比如SOCKETS,谁有的给我发个,其他的根据自己的需要配置,以下位XDEBUG配置
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下启动服务的脚本需要管理员权限,麻烦
: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以为的目录不行,报没有权限错误
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 }
增加两个主机,注意红色部分