我已经在 Windows XP SP3 上安装了 Apache 2.2 服务器和 PHP 5.3。初始安装后,Apache 加载了测试页面,即
http:/localhost (C:/Program Files/Apache2.2/htdocs/index.html) 显示“有效!”。
配置 Apache 并安装 PHP 后,尝试加载 http:/localhost/phptest.php 即 (C:/testsite/htdocs/phptest.php)。
但这会引发错误:
Not Found. The requested URL /phptest.php was not found on this server.
我现在加载也遇到同样的错误
http://localhost
httpd.conf 编辑:
ServerName localhost:80
DocumentRoot "C:/testsite/htdocs"
<Directory "C:/testsite/htdocs">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
LoadModule php5_module "c:/testsite/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddHandler application/x-httpd-php .php
PHPIniDir "C:/testsite/php"
文件 php.ini
编辑:
include_path = ".;C:\testsite\php\includes"
extension_dir = "C:/testsite/php/ext/"
系统路径:
PHP 目录已添加到 Windows 路径,例如
PATH=C:\Windows\System32;C:\many_dir;C:\testsite\php
Apache error.log 中唯一的错误是:
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2 /docs/dummy-host.localhost] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost] does not exist
Apache 服务重新启动成功并正在运行。我找不到任何不妥之处。谁能发现任何愚蠢的错误?
最佳答案
尝试在您的 conf 中将 Deny from all
更改为 Allow from all
,看看是否有帮助。
关于php - Apache:在此服务器上找不到请求的 URL。 Apache ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20696603/