php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
来源:互联网 发布:nginx 返回数据截断 编辑:程序博客网 时间:2024/05/20 05:29
curl_setopt(): Disabling safe uploads is no longer supported in xxx。定位到代码行:
所有问题都是因为 CURLOPT_SAFE_UPLOAD 这个选项。
1.查看手册发现,5.50添加该选项,默认值为false。5.6之后,默认值为true,这里另其为false。
2.手册上并未更新文档,7.0以后,不支持禁用该选项,所以导致了我们升级到7.0后,一直报错!
直接不用使用该选项了,网上有个解决方案是,并没有多大意义:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
上面的解决方法不合理,又找了点资料
php5.6关于curl以@方式上传文件的变化及解决七牛上传时报file is not specified in multipart的问题
上面的文章就提到了这个问题,但是针对的是php5.6
7.0后,curl不支持设置 CURLOPT_SAFE_UPLOAD设置为false,只能是true。但是提供了使用 CURLFile来替代的方案,可查看手册,手册中有人写到:
发现传输的post中有以 '@' 开头的文件,使用new CURLFile() 来转换,然后就可以不用设置 curlopt_safe_upload为false了。这个是5.5以后才支持的。为了兼容性,可以7.0以前,设置为curlopt_safe_upload=false,7.0后,发现@,进行curlfile来转换,就可以解决这个问题了,我们项目中的截图如下:
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- Xcode报错 Compiling IB documents for earlier than iOS7 is no longer supported.
- xcode9报错compiling ib doucument for earlier than ios7 is no longer supported
- xvim garbage collection is no longer supported
- garbage collection is no longer supported
- iOS开发之Xcode9报错 Compiling IB documents for earlier than iOS7 is no longer supported.
- 关于ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc
- Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5.
- 升级Xcode9.0,代码抱错 compiling IB documents for earlier than ios 7 is no longer supported
- ERROR: JVMPI, an experimental interface, is no longer supported.
- 安装cocos2d提示'root' is no longer supported解决方法
- cocos2d 'root' is no longer supported问题解决办法
- OSX 10.9 Compile error: garbage collection is no longer supported
- JVMPI, an experimental interface, is no longer supported.
- Android 7.0报错 java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
- [Play2.3]Ebean使用mysql中出现的not an enhanced entity bean. subclassing is not longer supported in ebean
- 数据结构---图的广度优先遍历和深度优先遍历
- Git:代码冲突常见解决方法--
- POJ 3522:Slim Span
- C# Invoke解读
- 使用sqlalchemy实现外键关联的例子(程序,本例子来源于sqlalchemy官网)
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- Hadoop之HDFS架构功能剖析说明
- Swiper实现图片滚动效果
- struts2与spring整合时提示无法注入bean的错误
- IOC,依赖倒置 (理解) Spring依赖注入的实现技术是:动态代理
- 剑指Offer——面试题22:栈的压入、弹出序列
- 在IntelliJ IDEA上使用Maven搭建SSM框架(二)
- Akka并发编程——1、Actor模型(一)
- dpdk issue