Access forbidden! While running Laravell Project - php

I am facing below error while running laravell project first time on my local xamp server
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403: localhost Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.4

This is nothing todo with Laravel, its the folder permissions, you need to make the root folder readable and make sure .htaccess is readable. As its local I would suggest setting the root folder to readable by everyone and try again.
Also it could be because you are not pointing your server to the public folder of your Laravel application

Related

XAMPP Apache not working on Ubuntu 20.04.3 LTS

I have been searching for hours now and I cant find a solution. I have tried much to many things to even start listing the things. So please any assistance would be appreciated.
I have changed the htdocs folder location in httpd.conf because I have all my files sync to cloud storage. This works perfectly on my windows machine but on linux not so much. Every thing runs perfectly but when I try to access my htdocs folder (new location) I get a message:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.48 (Unix) OpenSSL/1.1.1k PHP/8.0.10 mod_perl/2.0.11 Perl/v5.32.1
But When I change the location back to the normal location it works perfectly.
I have already gave full access to the folder.
Think of a directory structure as a series of security doors:
/var
/www
/htdocs
If you give someone a key to htdocs (i.e. set the permissions to give a user access) then they can open that door… but only if they can get to it.
If you don't also give them keys to www and var then they can't get into htdocs.

htaccess file and how to change permission's in it?

I have created a new folder example inside /var/www/html/ to run some php code. But when I try to access the files via localhost/example it is showing-
Forbidden
You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe
Apache/2.4.46 (Ubuntu) Server at localhost Port 80
The other files in the /var/www/html folder like localhost/welcome.php are still working. I also changed permission of the files. Should I create htaccess file and if so where? In general what is the process of creating a new project/folder to run php and it's relation to htaccess? A link for in-depth explanation would be much appreciated.

Forbidden Error in Apache after extracting files

My dedicated server has Debian wheezy installed along with Apache2 php and mysql. ISPConfig3 is installed as the control panel.
After creating a site under ISPConfig and a shell user account with it I uploaded the tar file into the web directory and extracted the files.
The default ispconfig index.html file would display how ever after the extraction the index.php is not getting picked up and after deleting the default index.php i get the error message
Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I tried going directly to www.domain.com/index.php and that doesnt work too.
Do I have to modify anything in apache? Any help would be appreciated.
That error is telling you the server can't read the file (or files) specified in your DirectoryIndex directive, and is trying to display a 403 (security) error document instead, which is doesn't have permission to read either.
You need to check what user your httpd daemon is running as, and make sure that user had at least read permissions to all the files in your DocumentRoot. The best way to do this is to ensure that user is the owner of the files.
On a Redhat/CentOS system, httpd runs as the user "apache"
chown -R apache:apache /var/www/html

When creating virtual-host, apache would work only with /var/www/html/ directory

I just moved from WAMP to LAMP, and can't figure out this problem that I am facing.
Whenever I create new vhost which is not in this directory /var/www/html/ i get a 403 forbidden message. (Permission are the same and there is an index file)
It seems to me that somewhere in Linux you specify a list of directories and apache works explicitly with those ones.
I use Apache 2.4.6.
I appreciate your help,
After checking the error log(vhost), I found this error message "search permissions are missing on a component of the path".
Meaning that one of the parent directories from where the vhost was located didn't not have search (+x) permission for the apache user.

Website local error

I'm building a website. For some reason when I try to run it on the local host, I get this message:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Sat Nov 20 22:19:02 2010
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1
What should I do to fix this so my website shows up on the local host. The website is coded in html/css/php. Thank you.
Look at the error logs.
I would agree with trying to read the apache log file for the specific error.
Sometimes, though, a 403 Forbidden error can be a simple permission error. Make sure the web directories are 755 and files are (atleast) 644 (but don't go chmod'ing everything to 777!)
For example,
chmod 755 /path/to/you/web/root
echo 'testing.. hello world!' > /path/to/you/web/root/test.php
chmod 644 /path/to/you/web/root/test.php
Hopefully that will get you going. If not, check your apache settings file (usually httpd.conf) and check out any mentioning of you web root. A 403 error can also be caused by apache trying to serve up a directory outside of it's WEBROOT.. meaning the webserver doesn't actually have access to the files.
Good luck.

Categories