Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 Forbidden trying to execute php scripts

Fresh install of a Debian server. Apache2, PHP5.

When I try to browse a PHP file I get 403 Forbidden. I am able to browse to html files.

I have tried the following:

  • Reinstalled Apache, PHP, libapache2-mod-php5
  • Restarted Apache
  • Checked the conf file thoroughly, copied from default, set the correct Directory path and allow from all
  • Checked permissions of directory, as a test have given full 777 permission to /var/www/site - still forbidden

Cant think of what else to try ?

like image 782
Tim Avatar asked Mar 28 '26 20:03

Tim


1 Answers

Perform chmod 755 of the directory in which the PHP scripts reside.

After that restart the Apache/nginx server

or

if above method not work then contact your hosting provider to whitelist that url to phpscript because it can be issue with mod_security. Its the most annoying thing hostgator user are facing.

like image 176
user889030 Avatar answered Mar 30 '26 11:03

user889030



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!