Codeigniter - 图片上传 - open_basedir 限制有效

Codeigniter - image upload - open_basedir restriction in effect

我有一个用 Codeigniter 框架编写的简单 cms。 它在许多项目中都运行良好,在我的本地机器上仍然运行良好。 但是,当我将我最近的网站(服务器 php 版本 5.5.17)上线并尝试上传图片时,出现此错误:

Message: file_exists(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.:/var/www/vhosts/web-test-host.tk:/tmp:/usr/share/php:/usr/share/pear:/var/lib/php/session) Filename: libraries/Image_lib.php

我都试过了,权限都设置好了,我什至把open_basedir值设置成none了,还是不想上传图片,也没搞定图片的名称。

服务器php版本是5.5.17。

您似乎正在尝试将文件写入 /。由于这超出了您的网站/虚拟主机允许的路径,因此您无法写入。检查你的脚本,路径配置,你一定在目标中丢失了一些东西。