2015-04-03 117 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

相關問題