在 Vista 上安装 Apache 2.2, PHP 5.2.6
今天,在Vista上安装了 Apache 2.2, PHP 5.2.6,花费了三四个小时。 Apache 和 PHP 的新版本,在相互兼容性方面似乎是越来越差了!
Apache 2.2 下载完后安装,倒是很顺利,最后 http://localhost, 显示 It works.
一开始,打算以 Module 形式安装 PHP,安装后显示 缺少不少库,并且不能显示 phpinfo.php。
于是改成以 CGI 形式重新安装,配置如下:
ScriptAlias /php/ "D:/software/PHP/"
AddType application/x-httpd-php .php
# For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"
打开网址,什么也访问不了:
You don’t have permission to access / on this server.
通过如下设置解决:
DocumentRoot “D:/programdata/Apachehtdocs”
Options FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from all
Satisfy all
然后就一直显示:
You don’t have permission to access /php/php-cgi.exe/phpinfo.php on this server.
在后台 error.log:
[error] [client 127.0.0.1] client denied by server configuration: D:/software/PHP/php-cgi.exe
最后,增加如下设置,解决了问题:
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
解决了问题。但是,后台又出现了一个问题:
[Sun Oct 12 22:36:57 2008] [error] [client 127.0.0.1] PHP Fatal error: require_once() [function.require]: Failed opening required ‘SAM/php_sam.php’ (include_path=’.;C:\\php5\\pear’) in sam_factory on line 1
这个问题的解决,参考 [RESOLVED] PHP Install Problem – SAM Error 我只是简单地安装PHP时,只选择 MySQL扩展。
Related posts:
Recent Comments