![](/img/trans.png)
[英]configure httpd.conf for PHP ( You don't have permission to access /php/php-cgi.exe/index.php on this server. )
[英]How to fix “You don't have permission to access /index.php on this server.” on 64bit WAMP 3
使用WAMP 3(Apache / 2.4.23(Win64)PHP / 7.0.10 mod_fcgid / 2.3.9服務器在本地主機端口80)
# Virtual Hosts
#
<Directory c:/wamp/www/testdir>
Options +Indexes +FollowSymLinks +Multiviews
AllowOverride all
Require local
</Directory>
<VirtualHost *:80>
ServerAdmin <emailaddress>
DocumentRoot "c:/wamp/www/testdir/"
ServerName prerelease.mydomain.com
DirectoryIndex index.php
ErrorLog "logs/prerelease.mydomain.com-error.log"
CustomLog "logs/prerelease.mydomain.com-access.log" common
</VirtualHost>
#
這是我的httpd.conf(僅在標准文件的末尾添加了這些行)
LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PHPRC "C:/wamp/bin/php/php7.0.10"
AddHandler fcgid-script .php
FcgidWrapper "C:/wamp/bin/php/php7.0.10/php-cgi.exe" .php
<IfModule fcgid_module>
FcgidIOTimeout 1200
FcgidConnectTimeout 1200
FcgidBusyScanInterval 1200
FcgidBusyTimeout 1200
FcgidErrorScanInterval 1200
FcgidIdleScanInterval 1200
FcgidIdleTimeout 1200
FcgidProcessLifeTime 3600
FcgidZombieScanInterval 1200
MaxRequestLen 15728640
FcgidMaxRequestLen 15728640
</IfModule>
我必須在這里閱讀20多個線程,並嘗試了許多無濟於事的解決方案。
以上所有內容均在WAMP的早期版本(Apache 2.4.9,PHP 5.5.12,相同的mod_fcgid.so文件)中起作用。
可能的解決方案
更改
<Directory c:/wamp/www/testdir>
Options +Indexes +FollowSymLinks +Multiviews
AllowOverride all
Require local
</Directory>
至
<Directory c:/wamp/www/testdir>
Options +Indexes +FollowSymLinks +Multiviews
AllowOverride all
Allow from all
</Directory>
它應該允許每個人的連接。
然后重新啟動APACHE。
嘗試安裝32位版本。 我了解您在技術上使用的是正確的版本,這只是我之前遇到的一個問題。 它為我工作。
將“ ExecCGI”添加到“選項”為我解決的問題:
<Directory / >
Options Indexes FollowSymLinks ExecCGI
# . . . . .
</Directory>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.