windows单机部署(开发版本)安装包下载

转:http://ecos.phpwindow.com/single_deployment/window.html


windows单机部署(开发版本)安装包下载nginx下载地址:[http://www.nginx.org/download/nginx-1.3.7.zip]php下载地址:[http://windows.php.net/downloads/releases/php-5.3.18-nts-Win32-VC9-x86.zip] (VC9 x86 Non Thread Safe 5.3.18 zip windows)mysql下载地址:[http://www.mysql.com/downloads/mirror.php?id=409760](windows 32位)[http://www.mysql.com/downloads/mirror.php?id=409777 ](windows 64位) 【下载时要登录,如果可以,就自己注册用户。已经注册好的用户:[email protected] anjiaxin】配置手册在nginx官网下载最新版本1.3.7的zip包,在php官网下载5.3.18版本的包将nginx和php解压放在e盘中,最好是同级目录(只作为建议,为修改配置文件方便,我的目录是e:/nginx;e:/php;e:/mysql;)配置php,内容如下:将php根目录下的“php.ini-development” 文件改名为“php.ini”配置php的扩展,在php.ini中找到以下的内容,将前面的分号“;”去掉 extension_dir="e:/php/ext" ;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_mbstring.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_openssl.dll ;extension=php_pdo_mysql.dll ;extension=php_sockets.dll ;extension=php_xmlrpc.dll 指定工作目录,在php.ini中找到“doc_root”把你的工作目录路径赋值给“doc_root” 例如:doc_root="e:/www"更改时区,在php.ini中找到‘date.timezone’给他赋值为‘prc’将以下文件复制到指定的目录 1、将‘php.ini’文件复制到“C:\windows”目录下面 2、将php根目录下面的文件“libeay32.dll, ssleay32.dll”复制到“C:/windows/system32”目录下面 3、将‘php/ext’目录下的文件“php_curl.dll,php_openssl.dll”复制到“C:/windows/system32”目录下面php配置完了,需要配置一下环境变量,步骤如下:找到环境变量(例如:windows xp 我的电脑右击->属性->高级->环境变量),具体如图:配置nginx。内容如下:编写启动nginx和php进程的bat文件,名称是:start_php.bat,放在nginx的安装目录的根目录下,内容如下: @echo off echo Starting PHP FastCGI... e:/php/php-cgi.exe -b 127.0.0.1:9000 -c e:/php/php.ini编写关闭nginx和php进程的bat文件,名称:stop_nginx.bat,和启动文件同目录,内容如下: @echo off echo Stopping nginx... taskkill /F /IM nginx.exe > nul echo Stopping PHP FastCGI... taskkill /F /IM php-cgi.exe > nul exit打开conf/nginx.conf,配置nginx,以下是配置好的文件内容,请对照配置自己的文件。 #user nobody; worker_processes 1; error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; root e:/www; charset utf-8; access_log logs/host.access.log; location / { root e:/www; index index.html index.htm index.php; autoindex on; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root e:/www; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php { include fastcgi_params; set $path_info ""; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } } 以上配置文件中有很重要一点需要说明一下: 1、文件中"root e:/www;" 和php.ini中的”doc_root="e:/www"“ 路径必须是一致的,负责无法解析php文件 2、文件中以下代码是为了配置nginx解析"pathinfo"函数 set $path_info ""; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info;php和nginx的连接需要以下的重要配置,请依照以下代码来修改php.ini中的代码 enable_dl = On cgi.force_redirect = 0 cgi.fix_pathinfo=1 fastcgi.impersonate = 1 cgi.rfc2616_headers = 1 allow_url_fopen = On到这里php+nginx算是配置完成了,在您的工作目录写入info.php,然后启动nginx和php。启动方法如下图所示的文件双击:在浏览器地址栏输入"localhost/info.php",info.php 文件如下

你可能感兴趣的:(php)