Could not open php://output for writing.问题解决
这是一个自己在项目中遇到的问题。
由于一直以来,公司都是用的Linux服务器,这次为客户做项目,换成了winserver。
项目中有一项功能是Excel导出,采用PHPEXCEL类库实现。由于是个小项目,直接用PhpStudy搭建了服务器环境,代理选的是Apache,注册系统服务,自启动,以Network Service身份登录。
测试的时候导出功能报错,提示Could not open php://output for writing。目测是由于Network Service账号的权限不足导致的。但翻遍了网上的资料也没找到解决办法。
Windows系统下的临时目录是C:\Windows\Temp没问题,给该目录加上Network Service的权限也无效。
后来有发现导入的时候同样报错了,无法读取excel文件,所以跟踪导入的代码,发现上传文件的临时目录竟然是C:\Windows。继续跟踪PHPEXCEL的代码,找到了sys_get_temp_dir()方法。查看phpinfo,发现sys_temp_dir变量为空,于是手工指定sys_temp_dir = "C:\Windows\Temp" upload_tmp_dir = C:\Windows\Temp。问题解决。
Could not open php://output for writing.问题解决的更多相关文章
- DTrace to Troubleshoot Java Native Memory Problems
How to Use DTrace to Troubleshoot Java Native Memory Problems on Oracle Solaris 11 Hands-On Labs of ...
- (转)MapReduce Design Patterns(chapter 7 (part 1))(十三)
CHAPTER 7.Input and Output Patterns 本章关注一个最经常忽略的问题,来改进MapReduce 的value:自定义输入和输出.我们并不会总使用Mapreduce本身的 ...
- pychart
Pychart PyChart is a Python library for creating high quality Encapsulated Postscript, PDF, PNG, or ...
- ubuntu 18.04下编译最新版本的KMS
KMS:kurento媒体服务,即 kurento media server 很庞大的一个WEBRTC项目,GIT库主项目:https://github.com/Kurento 基础实现,修改了gst ...
- cuffdiff problem--Performed 0 isoform-level transcription difference tests
如何解决cuffdiff运行结果中表达量为0的情况? cuffdiff -o cdiffout -b ref.fasta -u -p 15 --library-type fr-firststrand ...
- Introduction to Multi-Threaded, Multi-Core and Parallel Programming concepts
https://katyscode.wordpress.com/2013/05/17/introduction-to-multi-threaded-multi-core-and-parallel-pr ...
- 树梅派 -- 通过/sys读写ADC芯片 pcf8591
通过wiringPi等library, 在user space 通过/dev/i2c来读写i2c设备的方案不在本文讨论了. 编译SENSORS_PCF8591 模块 在Default raspberr ...
- Error:Some file crunching failed, see logs for details
Information:Gradle tasks [:myapp2:assembleDebug] Error:Some file crunching failed, see logs for deta ...
- ASP.NET Core In Process Hosting on IIS with ASP.NET Core 2.2(转载)
ASP.NET Core 2.2 has been out for a while now and with it come some significant improvements to the ...
随机推荐
- [Flex] 组件Tree系列 —— 实现右键拓展功能
主程序mxml: <?xml version="1.0" encoding="utf-8"?> <!--功能描述:结合tree拓展右键功能 必 ...
- 从零开始用 Flask 搭建一个网站(四)
前言 从零开始用 Flask 搭建一个网站(三) 介绍了网页前端与后端.前端与前端之间数据的交流.本节主要介绍一下如何应用 Flask-OAuthlib, 使用 Flask-OAuthlib 就可以轻 ...
- replace函数结合正则表达式实现转化成驼峰与转化成连接字符串的方法
//连接符转成驼峰写法 function toCamel(str){ var reg=/-(\w)/g; return str.replace(reg,function(){ return argum ...
- supervisor 使用
cat /etc/supervisord.conf https://www.cnblogs.com/yuzhoushenqi/p/6825204.html http://127.0.0.1:1001/ ...
- Linux安装Elasticsearch-head插件
首先需要下载以下内容: 我试验的对应版本:ES:elasticsearch-6.6.1.tar.gz Node:node-v10.15.3-linux-x64.tar JDK:jdk-8u201- ...
- CDH6安装文档
1.准备工作 1.1 环境 centos7.jdk8.mysql5.7.python2.7.CDH6 1.2文件下载 1.2.1 cloudmanger地址 https://archive.cloud ...
- VS中的DataPager分页
微软的DataPager分页功能很强大,不要设置数据库存储过程,只要添加个DataPager控件,关联下要分页的控件,简单设置就可以有不错的分页效果.当然要有更理想的效果还是要前台和后台处理下. wi ...
- vue 深度响应初步了解(检测data对象数据变化)
当你把一个普通的 JavaScript 对象传给 Vue 实例的 data 选项,Vue 将遍历此对象所有的属性,并使用Object.defineProperty把这些属性全部转为 getter/se ...
- lfs
LFS──Linux from Scratch,就是一种从网上直接下载源码,从头编译LINUX的安装方式.它不是发行版,只是一个菜谱,告诉你到哪里去买菜(下载源码),怎么把这些生东西( raw c ...
- 《大数据日知录》读书笔记-ch2数据复制与一致性
CAP理论:Consistency,Availability,Partition tolerance 对于一个分布式数据系统,CAP三要素不可兼得,至多实现其二.要么AP,要么CP,不存在CAP.分布 ...