这是一个自己在项目中遇到的问题。

由于一直以来,公司都是用的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.问题解决的更多相关文章

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

  2. (转)MapReduce Design Patterns(chapter 7 (part 1))(十三)

    CHAPTER 7.Input and Output Patterns 本章关注一个最经常忽略的问题,来改进MapReduce 的value:自定义输入和输出.我们并不会总使用Mapreduce本身的 ...

  3. pychart

    Pychart PyChart is a Python library for creating high quality Encapsulated Postscript, PDF, PNG, or ...

  4. ubuntu 18.04下编译最新版本的KMS

    KMS:kurento媒体服务,即 kurento media server 很庞大的一个WEBRTC项目,GIT库主项目:https://github.com/Kurento 基础实现,修改了gst ...

  5. cuffdiff problem--Performed 0 isoform-level transcription difference tests

    如何解决cuffdiff运行结果中表达量为0的情况? cuffdiff -o cdiffout -b ref.fasta -u -p 15 --library-type fr-firststrand ...

  6. 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 ...

  7. 树梅派 -- 通过/sys读写ADC芯片 pcf8591

    通过wiringPi等library, 在user space 通过/dev/i2c来读写i2c设备的方案不在本文讨论了. 编译SENSORS_PCF8591 模块 在Default raspberr ...

  8. Error:Some file crunching failed, see logs for details

    Information:Gradle tasks [:myapp2:assembleDebug] Error:Some file crunching failed, see logs for deta ...

  9. 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 ...

随机推荐

  1. CentOS 中卸载 RPM 包文件

    CentOS 中卸载 RPM 包文件 一.原由 因为之前卸载 openvas 这个工具,使用了 find / -name "openvas"-exec rm -rf {} \ ; ...

  2. Python多继承的C3算法

    C3算法 一.知识点补充: 拓扑排序:在图论中,拓扑排序(Topological Sorting) 是一个 有向无环图(DAG,Directed Acyclic Graph) 的所有顶点的线性序列.且 ...

  3. ios处理键盘的大小

    iOS的键盘有几个通知 UIKeyboardWillShowNotification UIKeyboardDidShowNotification UIKeyboardWillHideNotificat ...

  4. 大数据平台-java、mysql安装

    补充: 对于ssh登录不是特定端口22的,进行文件修改 vim /etc/ssh/sshd_config Port 61333 简化后序命令输入,修改文件如下:  一.java环境安装 一共5台服务器 ...

  5. Angular material mat-icon 资源参考_Navigation

    ul,li>ol { margin-bottom: 0 } dt { font-weight: 700 } dd { margin: 0 1.5em 1.5em } img { height: ...

  6. POJ_3368 Frequent values 【线段树+区间查询】

    一.题面 POJ3368 二.分析 仍然是一道只需要区间查询不需要区间修改的线段树题. 这题的题面比较特别,它是一组非减的数组.当需要去找一段区间内出现次数最多的数字时,这些数字必然是连续的,那么就可 ...

  7. Mike

  8. List<Type> 随机

    public List<T> GetRandomList<T>(List<T> inputList){ //Copy to a array T[] copyArra ...

  9. Celery ValueError: not enough values to unpack (expected 3, got 0)的解决方案

    Celery ValueError: not enough values to unpack (expected 3, got 0)的解决方案 背景 最近因项目需要,学习任务队列Celery的用法,跟 ...

  10. 用hashmap实现redis有什么问题

    1.容量问题 hashmap是有最大容量的 2.时效问题 redis可以持久化,也可以定时时间 hashmap不可以持久化 3.线程并发问题 hashmap不是线程安全的(并且:多线程同时调用hash ...