Win7下手动安装apache2.2、php5.4笔记
纯记录,流水账。
首先创建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,显示Itworks!
Apache安装完成。
--------------------------------------------------------
从http://windows.php.net/download/#php-5.4下载到php5.4最新稳定版5.4.21
注意需要下载:VC9x86ThreadSafe,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
拉到最底部:
LoadModulephp5_module"D:/www/php5.4.21/php5apache2_2.dll" LoadFileD:/www/php5.4.21/php5ts.dll LoadFileD:/www/php5.4.21/ssleay32.dll PHPIniDir"D:/www/php5.4.21" AddTypeapplication/x-httpd-php.php
这样php的支持就配完了。
再完善下:
ErrorLog"d:\www\logs\apache_error.log"
LogLevelerror
Includeconf/extra/httpd-vhosts.conf前面的注释#去掉
编辑httpd-vhosts.conf,假设web目录在e:/www下。
#NameVirtualHost*:80
FileETagnone
DirectoryIndexindex.htmlindex.php
<Directory"e:/hx/">
OptionsIndexesFollowSymLinksIncludes
AllowOverrideAll
Orderallow,deny
Allowfromall
</Directory>
<VirtualHost*:80>
ServerNamewww.nhooo.com
DocumentRoot"E:\hx\www.nhooo.com"
</VirtualHost>
打开D:\www\php5.4.21\php.ini
log_errors=On error_log=D:\www\logs\php_error.log
extension_dir="D:\www\php5.4.21\ext" extension=php_mysql.dll extension=php_curl.dll