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

mani95lisa's avatar

Permission stange bug when use storage folder with soft link

When I use Envoyer sometime after I deploied new version, I'll got Permission denied caused by save log.

Then I changed to use capistrano to deploy, got the same problem caused by session store, logs work fine.

All these situations, my storage folder is like below:

0 lrwxrwxrwx 1 root root 28 Jul 22 16:34 storage -> /var/www/poly/shared/storage

Could anybody tell me what's the possible reason?

Thanks!

0 likes
6 replies
billmurrin's avatar

Can you please provide an ls of the target directory

ls -la /var/www/poly/shared/storage

Your symlink may have proper permissions, but it does not necessarily reflect the permissions of the symlink target.

mani95lisa's avatar

@billmurrin can't create session folder automatically.

root@iZ25ff0xmp5Z:/var/www/poly/shared# ls -la /var/www/poly/shared/storage/
total 12
drwxrwxrwx 3 root root 4096 Jul 22 16:34 .
drwxr-xr-x 3 root root 4096 Jul 22 16:34 ..
drwxrwxrwx 2 root root 4096 Jul 22 16:35 logs
mani95lisa's avatar

@billmurrin here is shared folder

root@iZ25ff0xmp5Z:/var/www/poly/shared# ls -la /var/www/poly/shared
total 16
drwxr-xr-x 3 root root 4096 Jul 22 16:34 .
drwxr-xr-x 5 root root 4096 Jul 22 17:10 ..
-rw-r--r-- 1 root root  315 Jul 22 15:50 .env
drwxrwxrwx 3 root root 4096 Jul 22 16:34 storage
billmurrin's avatar

In my folders I have a app and framework folder in my storage folder (in addition to logs).

In the framework folder I have sessions and views folders.

Did you customize your config files to point to different locations than the default for sessions, etc?

mani95lisa's avatar

@billmurrin no, it should have views and sessions folder in storage, if I don't use ln folder, everything works fine. Now I got permission errors when save session. I have no idea what's the reason.

billmurrin's avatar

Sorry, my 5.1 install has a framework folder under storage.

Have you manually created your views and sessions folder in your symbolic folder since you said it can't be automatically created?

Please or to participate in this conversation.