Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stef's avatar
Level 1

laravel you don't have permission to access / on this server

Hello,

i have a curious problem with laravel 5.6.

I am using froxlor, debian stretch and PHP 7.2. Also i can login into my backend and do my changes, like adding customers, upload files and so on.

So far so good :-)

BUT, after some time, 5 or 10 minutes, i get "you don't have permission to access / on this server" in Chrome. So now, when i switch to FF i can continue my work, for the next 5-10 minutes, then i switch to Safari for the next 5-10 minutes and then the system seems to be locked for 1 hour. After some time, the match is beginning from new.

I have never had such a problem and i really don't know if the problem is anything on my server or laravel. I have 2 other laravel installations, also symfony, but there i don't have these phenomenon.

Rgds and thx for help

0 likes
5 replies
diegoaurino's avatar

Hello, @stef !

Do you only have access to your server via panel? It sounds like a permission problem. Make sure you have properly set the ownership and the permissions of your application folders and files. Also check the Apache directives and indexes.

Let me know if it helps.

stef's avatar
Level 1

Hello @diegoaurino

thank you for your reply, yes that could be the problem. I see that the owner is root, also the group and that is not good :-/

Do you have a tip for me to change it correctly?

Rgds

diegoaurino's avatar
Level 39

@STEF - Hello, @stef ! Hope you are doing great.

Here are some steps you can follow:

  1. If you're accessing the server with the root user, stop doing that. Create a new user, grant it sudo/admin access and add it to the www-data group.
  2. Before SSH into the server with this new user, make sure both SSH server and Iptables are properly set.
  3. As I don't know how your application was deployed and what it was designed for, I will give you a general approach to set the ownership of the projects folder. In general, apps are under the /var/www on Debian based distributions. I hope your project is there. Otherwise, it can be under your $HOME folder. If your user is properly configured and secured, you can use sudo chown -R $USER:$USER /var/www to set the ownership. Then, go to your project root folder and do sudo chown -R :www-data storage bootstrap/cache.
  4. Use sudo chmod -R 775 storage bootstrap/cache to set the permissions recursively for storage and bootstrap/cache.

In general, that is it.

####Suggestions:

You also need to make sure the Apache DocumentRoot is pointing to the /public folder and the proper directives are set for the project directory. Otherwise, your configuration and environment files will be exposed and Apache will not be able to correctly follow the routes.

Let me know if it helps.

stef's avatar
Level 1

Hello @diegoaurino,

i did it easier, i installed Plesk :-) From beginning we had problems with Froxlor, now everything is working :-)

Thx for your help and best wishes to you.

Please or to participate in this conversation.