Page 1 of 1

open_basedir restriction in effect

Posted: Tue Aug 09, 2016 4:41 pm
by samuelcdossantos
Good afternoon, I am Brazilian.

I have a problem on my server (Ubuntu 15.10 x64) in PHP upload. Erro(I hid the domain for security reasons)r:
Message: copy(): open_basedir restriction in effect. File() is not within the allowed path(s): (/home/admin/web/**********/public_html:/home/admin/tmp)

Check that in the /home/admin/conf/web/apache2.conf php_admin_value is as follows:

<Directory /home/admin/web/cloudone.eti.br/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/admin/web/**********/public_html:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>


How to solve ?

Re: open_basedir restriction in effect

Posted: Thu Aug 11, 2016 12:29 pm
by skurudo
samuelcdossantos wrote: How to solve ?
You can add additional folder in open_basedir

Code: Select all

php_admin_value open_basedir /home/admin/web/**********/public_html:/home/admin/tmp:/path/to/my/another/folder
or if you don't like security - disable open_basedir (not recommend this, but if you like you can)

Re: open_basedir restriction in effect

Posted: Mon Jan 30, 2017 9:49 am
by plutocrat
Note ... if you're using SSL, you'll ALSO need to edit
/home/admin/conf/web/sapache2.conf

Just wasted a couple of hours on that! :-)

Re: open_basedir restriction in effect

Posted: Mon Jan 30, 2017 6:01 pm
by skurudo
plutocrat wrote:Note ... if you're using SSL, you'll ALSO need to edit
/home/admin/conf/web/sapache2.conf
Yep, but it's a little better than no open_basedir at all ;-)

Re: open_basedir restriction in effect

Posted: Wed Feb 01, 2017 8:52 am
by plutocrat
skurudo wrote:Yep, but it's a little better than no open_basedir at all ;-)
Sure. Just thought I'd mention it to help someone out in the future. I've also just realised (still learning ...), that if you ever regenerate the configs, you'll lose those changes, so you'll have to re-apply them.
Alternatively you can make some custom templates in /usr/local/vesta/data/templates/web/apache2 and select those in the website template selection box.