Search code examples
phpandroidapiconnectionwampserver

Forbidden: You don't have permission to access / on the server


This is the error that I get when I try to access the PC from my phone.

enter image description here


Solution

  • in your apache.conf file

    <Directory "/var/www/html/yourwebroot">
        AllowOverride All 
        Allow from all
        Require all granted
    </Directory>
    

    and restart your apache2 server

    The access control configuration changed in 2.4, and old configurations aren't compatible without some changes. See here.

    If your old config was Allow from all (no IP addresses blocked from accessing the service), then Require all granted is the new functional equivilent.