当系统开启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. compass安装使用960 Grid System

    960 Grid System 是一个CSS的页面布局框架 demo:  http://960.gs/demo.html 前提:安装Ruby .NodeJS 步骤1:在命令行下安装css插件: gem ...

  2. Java它配备了一个很好的工具2

    Jconsole 本机java自带的系统monitor具,它也可以连接到的本地远程连接java process,联系java process申请后可查看CPU,内存,主题.GC事件,能帮忙看看系统是否 ...

  3. Oracle压缩总结2— 估计表压缩效应

    使用压缩前,我们可以估算压缩能有多大效果. 11gr2我已经能够使用dbms_comp_advisor,具体代码见附件.只需要运行两个文件dbmscomp.sql和prvtcomp.plb.然后使用D ...

  4. spring与mybatis集成和事务控制

    一个. 基本介绍 本文将使用spring整合mybatis, 并加入事务管理, 以此为记, 方便以后查阅. 二. 样例 1. 代码结构图: 2. 建表语句: DROP DATABASE test; C ...

  5. hibernate Disabling contextual LOB creation as connection was null

    使用hibernate通路sybase当遇到异常. Could not obtain connection metadata : ASE is now using a multi-byte c ...

  6. Simditor图片上传

    上一篇文章(Simditor用法)仅仅是简单的默认配置,我们可自己定义工具栏button使其更丰富和实现上传图片功能 初始化编辑器 <script type="text/javascr ...

  7. Redux管理你的React应用

    使用Redux管理你的React应用   因为redux和react的版本更新的比较频繁,博客园这里用的redux版本是1.0.1,如果你关心最新版本的使用技巧,欢迎来我的Github查看(https ...

  8. a^b%c 的三种形式

    求a^b%c,(1  <= a,b <= 2^62, 1 <= c <= 10^9) 最主要的高速幂 _LL mod_exp(_LL a, _LL b, int c) { _L ...

  9. 一步一步的理解C++STL迭代器

    一步一步的理解C++STL迭代器 "指针"对全部C/C++的程序猿来说,一点都不陌生. 在接触到C语言中的malloc函数和C++中的new函数后.我们也知道这两个函数返回的都是一 ...

  10. 波折yosemite下载过程

    已经知道Yosemite正式宣布了这一消息,为了尽快有效地使用该系统尽可能.上学前把一个新的硬盘驱动器准备就绪-但不幸的是,我不知道是谁动手当天学校欠网关停电,我没有强迫受害者上课听老师讲废话(这是什 ...