纯记录,流水账。
首先创建d:\www目录,我们把web环境软件都装到这个目录下。
创建d:\www\logs目录,一些日志会放在这里。
从http://mirrors.cnnic.cn/apache/httpd/binaries/win32/ (apache.org上提到的镜像站点)下载到了httpd-2.2.25-win32-x86-openssl-0.9.8y.msi
安装apache2.2.25,选了下安装路径d:\www\apache2.2,其它都是下一步完成安装。
访问localhost,显示It works!
Apache安装完成。
——————————————————–
从http://windows.php.net/download/#php-5.4下载到php5.4最新稳定版5.4.21
注意需要下载:VC9 x86 Thread Safe ,zip版的,否则nts是没有php5apache2_2.dll文件的,当时浪费了我不少时间。
http://windows.php.net/downloads/releases/php-5.4.21-Win32-VC9-x86.zip
下完解压到d:\www\php-5.4.21
打开apache2.2\conf\httpd.conf
拉到最底部:
<br />LoadModule php5_module "D:/www/php5.4.21/php5apache2_2.dll"<br />LoadFile D:/www/php5.4.21/php5ts.dll<br />LoadFile D:/www/php5.4.21/ssleay32.dll<br />PHPIniDir "D:/www/php5.4.21"<br />AddType application/<b>6本文来源gao@dai!ma.com搞$代^码!网7</b><pre>搞gaodaima代码
x-httpd-php .php
这样php的支持就配完了。
再完善下:
<br />ErrorLog "d:\www\logs\apache_error.log"<br />LogLevel error<br />Include conf/extra/httpd-vhosts.conf前面的注释#去掉<br />编辑httpd-vhosts.conf,假设web目录在e:/www下。<br />#NameVirtualHost *:80<br />FileETag none<br />DirectoryIndex index.html index.php<br /><br /> Options Indexes FollowSymLinks Includes<br /> AllowOverride All<br /> Order allow,deny<br /> Allow from all<br /><br /><br /> ServerName www.gaodaima.com<br /> DocumentRoot "E:\hx\www.gaodaima.com" <br /><br />
打开D:\www\php5.4.21\php.ini
<br />log_errors = On<br />error_log = D:\www\logs\php_error.log</p><p>extension_dir="D:\www\php5.4.21\ext"<br />extension=php_mysql.dll<br />extension=php_curl.dll<br />
其它看情况配置
这样web环境就基本上配好了。
——————————–
附加:
下载apc,以前需要到处找,现在官方提供了!在http://pecl.php.net/package/APC下载最新版:http://windows.php.net/downloads/pecl/releases/apc/3.1.13/php_apc-3.1.13-5.4-ts-vc9-x86.zip,解压php_apc.dll到D:\www\php5.4.21\ext目录。
要下memcache.dll,也有提供了,http://pecl.php.net/package/memcache。
<br />extension=php_apc.dll<br />extension=php_memcache.dll<br />
不过,apc这个版本似乎有点问题。
总是出这些,只好不启用。
<br />Notice: Unknown: 1. h->opened_path=[null] h->filename=[E:/hx/www.gaodaima.com/test_file.php] in Unknown on line 0</p><p>Notice: Unknown: apc_cache_find [-833243605] in Unknown on line 0</p><p>Notice: Unknown: 2. h->opened_path=[E:/hx/www.gaodaima.com\test_file.php] h->filename=[E:/hx/www.gaodaima.com/test_file.php] in Unknown on line 0</p><p>Notice: Unknown: apc_cache_make_file_entry: entry->data.file.filename is [E:/hx/www.gaodaima.com\test_file.php] in Unknown on line 0<br />