kossa's avatar
Level 20

Issue when uploading file

Hello,

When I try to upload a file via Laravel I get this error :

ErrorException in Local.php line 76:
is_link(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/domain-name.dz/:/tmp/)

In local works fine :/

0 likes
3 replies
jlrdw's avatar

Check permissions, clear all cache and report back. Oh and remember a linux server is case sensitive.

spekkionu's avatar

Looks like your server is setup incorrectly.

It is using open_basedir which limits access to only inside specific directories (in this case likely your user folder). The problem is that the upload_tmp_dir is set to /tmp which is outside this directory and thus php cannot access the uploaded file in it.

You can try adding a php.ini file to your webroot with upload_tmp_dir = /some/directory/inside/your/user/folder (make sure to also create said directory) and see if that helps.

kossa's avatar
kossa
OP
Best Answer
Level 20

You're right @spekkionu, I tried a simple php script it works fine, after that I found that I changed the path in config/filesystems and changed the local.root

Please or to participate in this conversation.