skip to Main Content

I am trying to open a simple Hello World php file. But every time I try and run the file on my localhost server I get the following message. I have even tried editing the httpd-xampp.conf in the apache folder in xampp granting all but with no luck.

Error Message

Forbidden

You don’t have permission to access this resource.`

Apache/2.4.48 (Win64) OpenSSL/1.1.1l PHP/8.0.10 Server at localhost Port 80

2

Answers


  1. It’s difficult for us to diagnose your problem without inspecting your server configuration, but (assuming you have PHP installed okay) as a stop gap to get you up and running until you figure out this problem, you can use the built in PHP webserver. Open a command prompt or terminal in the directory where you want your document root to be and enter the following command:

    php -S localhost:8000
    

    Then navigate to http://localhost:8000 in your browser.

    https://www.php.net/manual/en/features.commandline.webserver.php

    Login or Signup to reply.
  2. Open your apache configuration file and grant access for the directory that the php file is located in, example

    <Directory "/folder/subfolder/noob/subfolder">
        Require all granted
    </Directory>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search