关于curl,open_basedir,safe_mode的错误问题
2台web环境基本一致的服务器,一台执行curl时出现提示
PHP Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in xxx
按照提示,检查php配置,safe_mode是关闭的,curl的配置如下
另外一台不出现此错误的服务器curl配置如下
虚拟主机配置中,2者都有open_basedir。
将报错的服务器上的虚拟主机节点的open_basedir注释,不再出错。
怪哉。
如果要使用curl获取返回301状态码网页就必须将open_basedir设置为空的话,就会导致网站跨站攻击安全问题。
重点是另外一台为什么可以配置open_basedir不报错。
先mark一下,等待后续解决。