简体   繁体   中英

How to fix “You don't have permission to access /index.php on this server.” on 64bit WAMP 3

Using WAMP 3 (Apache/2.4.23 (Win64) PHP/7.0.10 mod_fcgid/2.3.9 Server at localhost Port 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>
#

Here is my httpd.conf (only added these lines at the end of the standard file)

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>

I must have read over 20 threads here and tried numerous solutions to no avail.

All of the above worked in the previous version of WAMP (Apache 2.4.9, PHP 5.5.12, same mod_fcgid.so file).

Possible solution

Change

<Directory c:/wamp/www/testdir>
    Options +Indexes +FollowSymLinks +Multiviews
    AllowOverride all
    Require local
</Directory>

to

<Directory c:/wamp/www/testdir>
    Options +Indexes +FollowSymLinks +Multiviews
    AllowOverride all
    Allow from all
</Directory>

It should allow connection from every one.

And after it restart APACHE.

Try installing the 32 bit version. I understand that you are using the correct version technically, it's just an issue I've run into before. It worked for me.

Addind "ExecCGI" to Options solved issue for me:

<Directory / >
  Options Indexes FollowSymLinks ExecCGI
  # . . . . .
</Directory>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM