curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in
当系统开启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的更多相关文章
- 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 ...
- 当系统开启safe_mode和 open_basedir
当系统开启safe_mode和 open_basedir,在程序中使用以下语句curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);并且遇到301,302状态吗时 ...
- BTC功能类
<?php/*EasyBitcoin-PHP A simple class for making calls to Bitcoin's API using PHP.https://github. ...
- add web server(nginx+apache)
#!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...
- apache虚拟主机配置及常用安全配置
环境准备: 服务器系统:CentOS 6.5 安装lamp环境: yum -y install mysql mysql-server php php-mysql httpd php-gd* freet ...
- PHPAdmin的安装和配置
phpadmin是用于管理mysql数据库的一个产品,,毕竟很多数据库服务器不能够公开连接,所以只能够使用http的方式来进行连接管理. 下载phpadmin( http://xj-http. ...
- nginx反向代理结合apache和php的配置示例
.前端nginx主配置文件 # cat nginx.conf worker_processes ; #pid logs/nginx.pid; pid /data/www/logs/nginx.pid; ...
- PHP中CURL方法curl_setopt()函数的参数
PHP CURL curl_setopt 参数 bool curl_setopt (int ch, string option, mixed value)curl_setopt()函数将为一个CURL ...
- PHP中CURL方法curl_setopt()函数的一些参数 (转)
bool curl_setopt (int ch, string option, mixed value) curl_setopt()函数将为一个CURL会话设置选项.option参数是你想要的设置, ...
随机推荐
- STL 清除模板容器 clear.h
#pragma once #include "GeometricMacro.h" #include "GeometricEnum.h" #include &qu ...
- 跑Java -jar somefile.jar时会发生什么(一个)
最近阅读JVM源代码.一些想法写Blog分享.于是,他开了这么一个新课题. 第一篇文章取名字的时候让我很困惑,我代码的阅读是从Launcher開始入手的,也就是Java.exe(假设是windows平 ...
- MEF初体验之二:定义组合部件和契约
组合部件 在MEF中,一个组合部件就是一个组合单元,组合部件"出口"其它组合部件需要的服务并且从其它部件"进口"需要的服务.在MEF编程模型中,为了声明组合部件 ...
- nisi 脚本示例
只是简单的copy文件和添加快捷方式,安装和卸载时对程序是否运行进行检测 ;-------------------------------- ;Include Modern UI !include & ...
- 3-08. 栈模拟队列(25)(ZJU_PAT 模拟)
主题链接:http://pat.zju.edu.cn/contests/ds/3-08 设已知有两个堆栈S1和S2,请用这两个堆栈模拟出一个队列Q. 所谓用堆栈模拟队列,实际上就是通过调用堆栈的下列操 ...
- [WebGL入门]四,渲染准备
注意:文章翻译http://wgld.org/,原作者杉本雅広(doxas),文章中假设有我的额外说明,我会加上[lufy:].另外.鄙人webgl研究还不够深入,一些专业词语,假设翻译有误,欢迎大家 ...
- 实现键值对存储(三):Kyoto Cabinet 和LevelDB的架构比較分析
译自 Emmanuel Goossaert (CodeCapsule.com) 在本文中,我将会逐组件地把Kyoto Cabinet 和 LevelDB的架构过一遍.目标和本系列第二部分讲的差点儿相 ...
- [模拟] hdu 4452 Running Rabbits
意甲冠军: 两个人在一个人(1,1),一个人(N,N) 要人人搬家每秒的速度v.而一个s代表移动s左转方向秒 特别值得注意的是假设壁,反弹.改变方向 例如,在(1,1),采取的一个步骤,以左(1,0) ...
- C#将image中的显示的图片转换成二进制
原文:C#将image中的显示的图片转换成二进制 1.将Image图像文件存入到数据库中 我们知道数据库里的Image类型的数据是"二进制数据",因此必须将图像文件转换成字节数组才 ...
- 以正确的方式开源 Python 项目(转)
大多数Python开发者至少都写过一个像工具.脚本.库或框架等对其他人也有用的工具.我写这篇文章的目的是让现有Python代码的开源过程尽可能清晰和无痛.我不是简单的指——“创建一个GitHub库,提 ...