首页 > 其他 > 详细

curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in

时间:2014-09-14 02:31:56      阅读:322      评论:0      收藏:0      [点我收藏+]

当系统开启safe_mode和 open_basedir,在程序中使用以下语句
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
并且遇到301,302状态吗时会出现错误

[11-Oct-2010 14:17:41] PHP Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in msn.class.php on line 819

解决方法是在curl语句不使用curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true),或者改为0,在php函数中自定义一个函数

curl_redir_exec函数
curl_redir_exec

curl_redir_exec($ch)替换curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true)语句

参考:

http://spoint.babyshoot.cn/archives/2009/11/curlopt-php.html

http://www.php.net/manual/en/function.curl-setopt.php

curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in

原文:http://www.cnblogs.com/baocheng/p/3970611.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!