当系统开启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的更多相关文章

  1. 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 activate ...

  2. 当系统开启safe_mode和 open_basedir

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

  3. BTC功能类

    <?php/*EasyBitcoin-PHP A simple class for making calls to Bitcoin's API using PHP.https://github. ...

  4. add web server(nginx+apache)

    #!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...

  5. apache虚拟主机配置及常用安全配置

    环境准备: 服务器系统:CentOS 6.5 安装lamp环境: yum -y install mysql mysql-server php php-mysql httpd php-gd* freet ...

  6. PHPAdmin的安装和配置

    phpadmin是用于管理mysql数据库的一个产品,,毕竟很多数据库服务器不能够公开连接,所以只能够使用http的方式来进行连接管理.     下载phpadmin( http://xj-http. ...

  7. nginx反向代理结合apache和php的配置示例

    .前端nginx主配置文件 # cat nginx.conf worker_processes ; #pid logs/nginx.pid; pid /data/www/logs/nginx.pid; ...

  8. PHP中CURL方法curl_setopt()函数的参数

    PHP CURL curl_setopt 参数 bool curl_setopt (int ch, string option, mixed value)curl_setopt()函数将为一个CURL ...

  9. PHP中CURL方法curl_setopt()函数的一些参数 (转)

    bool curl_setopt (int ch, string option, mixed value) curl_setopt()函数将为一个CURL会话设置选项.option参数是你想要的设置, ...

随机推荐

  1. 跳跃Java一些周期,双跳FOR周期

    今天写的代码写在一个双层for周期,目前仍在使用Iterator,大致意思是假定在第二个周期在排位赛中给了整个双回路跳. 刚開始,直接使用break.巴拉巴拉的敲了一堆代码,信心满满的就直接执行.等到 ...

  2. 正则、grep、sed、awk

    每次用到正则都要蛋疼一下,索性总结一下在这里. 正则 正則表達式主要分为基础正则和扩展正则.注意,正则和一般命令行输入的命令的通配符不同.正则仅仅使用于支持这样的表示法的工具,如:vi,grep,se ...

  3. 采用 matlab 阅读SAR 元数据

    这方面能够參考书籍:"Digital processing of synthetic aperture radar data", by Ian Cumming and Frank ...

  4. Hadoop-2.2.0中国文献—— Web应用代理

    Web应用代理是YARN的一部分. 默认地,它会作为 Resource Manager(RM)的一部分来执行, 可是也能够配置成独立执行的模式.使用代理的原因就是减少通过YARN的web攻击的可能性. ...

  5. 提高duilib的richedit控制的一些特征

    转载请注明原始出处.谢谢~~:http://blog.csdn.net/zhuhongshu/article/details/41208207 假设要使用透明异形窗口功能,首先要改进duilib库让他 ...

  6. 如何关闭CBox(2.4版本号)强制升级的形式

    从今天开始2.4.0.9版本号CBox,提示检测到新的版本号,能够使用后必须更新为新版本号,提示表见下面的例子. 此次升级是强制升级.假如你选择不升级(单击窗体上的升级提示右下角"辍学but ...

  7. u_boot启动过程中的具体分析(1)

    闭上眼睛,细致的回顾一下从NAND FLASH 启动的整个流程,首先,当我们打开板子的时候,先执行的就是嵌入在芯片上的iROM,它的作用就是为了把.NAND Flash 中的bootloader的一部 ...

  8. 【Linux】CentOS系统

    版本号:CentOS release 5.7 1)查看系统版本号 cat  /etc/readhat-release 2)安装软件 wget  资源链接 make make install 在线安装: ...

  9. C++在stack的deque实现

     本文实现STL在stack大部分功能,同时加入了许多功能. 请注意以下几点: 1.Stack它是一个适配器,在底部vector.list.deque等实现 2.Stack不含有迭代器 在本例中, ...

  10. 【C语言的日常实践(八)】弦

    串数据类型是一个重要的,但C有没有明确的语言字符串数据类型.头文件string.h它包括大多数字符串处理函数. 故,有操作的串.通常包括string.h头文件. 1.字符串的长度:对字符串进行的操作中 ...