windows环境php5+apache2+mysql5的安装
本人在windows sp2+apache2.2.2+php5.1.4+mysql5.0环境下的安装步骤如下:
一:下载安装apache
1:下载
http://httpd.apache.org/download.cgi win32 Binary(MSI Installer)。
2:安装:
停掉IIS(如果装了的话(www publishing服务)),正常安装(注意要设置admin的email)。
二:下载安装PHP5
1:下载:
www.php.net/downloads.php 下载zip版,不要下载installer版。
2:安装:
把zip文件夹解压到d:/php5下,
d:/php/php5ts.dll cut (not copy) to c:/windows/php5ts.dll
三:配置apache+PHP5
1:创建站点文件目录 c:/webs/test
2:重命名d:/php/php.ini-dist 为 d:/php/php.ini, 做如下修改 d:/php/php.ini file:
(1) doc_root = "c:/webs/test" and (2) extension_dir = "d:/php/ext"
3: 设置apache httpd.conf文件(C:/Program Files/Apache Group/Apache2/conf/httpd.conf)
3.1 change the DocumentRoot entry to: DocumentRoot "C:/webs/test"
3.2 change the Directory entry to: <Directory "C:/webs/test">.
3.3 add the following lines: hint: to find this position fast, search for "media types"
ScriptAlias /php/ "d:/php5/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "d:/php5"
3.4 Find the "DirectoryIndex" entry and add "index.php" 通过跟路径可以访问到index.php
4:测试
4.1:写一个index.php文件
内容
Today is <? print strftime("%m/%d/%Y"); ?>
4.2:重启apache。
4.3:访问http://localhost 看是否成功。