basedir restriction in effect. File(/) is not within the allowed path(s):

I'm getting this error on an avatar upload on my site. I've never gotten it before and nothing was changed recently for me to begin getting this error...

Warning: is_writable() [function.is-writable]: 
open_basedir restriction in effect. 
File(/) is not within the allowed path(s):

Modify the open_basedir settings in your PHP configuration (See Runtime Configuration).

The open_basedir setting is primarily used to prevent PHP scripts for a particular user from accessing files in another user's account. So usually, any files in your own account should be readable by your own scripts.

Example settings via .htaccess if PHP runs as Apache module on a Linux system:

<DirectoryMatch "/home/sites/site81/">
    php_admin_value open_basedir "/home/sites/site81/:/tmp/:/"
</DirectoryMatch>

Modify the open_basedir settings in your hosting account and set them to none. Find the open_basedir setting given under 'PHP Settings' area of your Plesk/cPanel. Set it to 'none' from the dropdown given there. I have shown them in the Plesk panel picture.

在这里输入图像描述在这里输入图像描述


To resolve this error, you must edit the file httpd.conf. Way before it can be seen in phpinfo in apache2handler section directive Server Root. For example, in my case this way - / etc / httpd / httpd.conf. Open the file httpd.conf, find the mention of the parameter open_basedir. And set it to none. ( php_admin_value open_basedir none )

链接地址: http://www.djcxy.com/p/11884.html

上一篇: 没有执行PHP代码,而是在页面上显示代码

下一篇: basedir限制有效。 文件(/)不在允许的路径中: