标题:windows XP下安装Apache 2.2.4和PHP 5.2.2 出处:BirdSky 时间:Mon, 28 May 2007 00:27:54 +0000 作者:birdsky 地址:https://www.birdsky.cn/read.php?5 内容: 点击在新窗口中浏览此图片 https://www.birdsky.cn/att...   今天配置了环境时,差点没郁闷死。   先是下了最新的Apache 2.2.4 ,一直默认下去,很快装好啦,一启动,失败[emot]cry[/emot] 一查,“could not bind to address 0.0.0.0:80”,[emot]question[/emot]晕,我什么时候设了0.0.0.0了,我是设的localhost啊[emot]cry[/emot],再查Apache配置文件http.conf,服务名没错 ServerName localhost:80 再看监听端口,才发现,默认为 Listen 80 有一行解释为Change this to Listen on specific IP addresses as shown below to prevent Apache from glomming onto all bound IP addresses (0.0.0.0),晕死,以前都是默认为127.0.0.1的,新版既然默认为0.0.0.0啦,赶紧改为 Listen localhost:80 再一重启,OK[emot]grin[/emot]   接着去下了最新的php 5.2.2 ,也是一路默认到安装模式,因为php的typic模式会装少很多扩展模块,我就选了custom模式,然后全选安装,然后一路安装也是没任务问题。   可到了apache重启时就再也起不来啦[emot]fear[/emot]   一查http.conf,晕,php当成cgi模式配给我了,还将apache, apache2, apache2.2 全配上了,一查线程,果然起了三个,晕,赶紧删掉,最后配为 LoadModule php5_module "D:\PHP\\php5apache2_2.dll" AddType application/x-httpd-php .php 再一重启,还是不行[emot]cry[/emot],查系统日志,模块没找到,喔,忘了,将php下的的dll文件和php/ext下的dll文件全拷到windows/system32下,php.ini拷到windows下,再重启,还不行[emot]anger[/emot],火起,将php.ini里的没用扩展模块先全屏蔽掉,最后只留常用的几个模块 [PHP_CURL] extension=php_curl.dll [PHP_EXIF] extension=php_exif.dll [PHP_GD2] extension=php_gd2.dll [PHP_GETTEXT] extension=php_gettext.dll [PHP_MCRYPT] extension=php_mcrypt.dll [PHP_MHASH] extension=php_mhash.dll [PHP_MYSQL] extension=php_mysql.dll [PHP_MYSQLI] extension=php_mysqli.dll 再重启,哈哈,总算OK啦[emot]grin[/emot] PS:windows下的php.ini和php目录下的php.ini最好保护一致,发现服务两个都读到一样。 Generated by Bo-blog 2.0.2 sp1