2015-04-03 85 views
0

我使用MSI安装程序安装的Apache 2.4,当我在浏览器上我得到的消息键入localhost“它的工作原理”。的http://本地主机:8080说,访问被拒绝

我通过添加下列行

LoadModule php5_module "C:/php/php5apache2_4.dll" 
AddHandler application/x-httpd-php .php 
# configure the path to php.ini 
PHPIniDir "C:/php" 

我也在httpd.conf文件添加index.php来DirectoryIndex变量,未注释extension_dir = “ext”php.ini文件

htdocs创建index.php配置httpd.conf文件文件夹,当我在浏览器中尝试http://localhost:8080时,表示拒绝访问。

任何人都可以帮忙吗?我跟着指示按http://vitalflux.com/php-install-apache-2-4-php-5-6-windows/

回答

0

你必须告诉Apache是​​index.php是一个有效的目录索引。如果它没有找到有效的目录索引文件并且目录列表被禁用,则它将抛出一个403 Access Denied

Apend给你的httpd.conf

DirectoryIndex index.php 

记得重新启动Apache服务器使更改生效。

+0

我的httpd.conf文件已经下面的代码, ' 的DirectoryIndex index.php文件index.html的 ' 你是在暗示要删除'index.heml',只保留'指数。 .php'? – Justin 2015-04-03 08:13:51

+0

现在奇怪的是,我在Windows服务中找不到Apache。当我开始从开始菜单选项的服务,在命令提示符下出现以下消息'系统找不到指定的文件:AH00436:命名Apache2.4' 如果我在C盘重命名文件夹的Apache安装无服务器到apache2.4? – Justin 2015-04-03 08:24:23

+0

有什么建议吗? – Justin 2015-04-05 22:53:40

相关问题