💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
主站A在服务器上的web根目录为`/www/wwwroot/A/` 回源站点B的web根目录为`/www/wwwroot/B/` 主站A使用php5开发,当有文件上传时,经过安全验证的文件要移动到站点B的`data`目录中。 使用php中的函数`move_uploaded_file()`移动上传的文件到`B/data/`目录中时报错,信息如下: ``` move_uploaded_file(): open_basedir restriction in effect. File(/www/wwwroot/B/data/xxxxxxxx.txt) is not within the allowed path(s): (/www/wwwroot/A/:/tmp/:/proc/) ``` # 解决方法 将`/www/wwwroot/B/data/`添加到站点A的`open_basedir`设置中即可。 ``` 原来配置文件是隐藏文件`.user.ini` 打开A的`.user.ini` 改成 `user.ini:open_basedir=/www/wwwroot/A/:/tmp/:/proc/:/www/wwwroot/B/data/` 保存,重启nginx。 ```