首页 > 代码库 > Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set…

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set…

php打印小票错误提示:Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set…

解决办法:

curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转   

将该语句中的1换成0就可以了,也就是   curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0); 

我是这样改就可以了

技术分享

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set…