我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Php tmpfile仅适用于命令行

When I run this:

$file = tmpfile();
$name = stream_get_meta_data($file)['uri'];
$nfile = new SplFileObject($name);
var_dump($nfile);

from the command line, it works as expected - creating a temporary file, and dumping details about it. However, when I run it through apache, $nfile is an empty object - it seems to be unable to access the file by path. Why is this? I have already confirmed that it is creating a file, and I can see the temporary file in the file system, so it's just php that can't reach it.

近期文章

  • 无法使用cURL打开本地文件
  • Magento 1.8.1 - 从购物车中删除“编辑”
  • PHP中的De- /可激活类扩展
  • 从android发送文本和表情符号到PHP?
  • 将数组从js文件获取到php中,然后编码为json
  • 如何解析从curl网站收到的网站内容
  • php csv imap下载
  • Google Apps Email Audit API:POST请求,用于创建用户邮箱的监视器
  • HHVM:获取失败调用MemcachedSessionModule :: gc()的后果是什么
  • ZF2:pthreads - 传递PDO
  • 在php中填充select标签
  • 在Magento中获取外部会话
  • 如何使用定义为服务的表单将数组数据映射到Symfony2实体?
  • 上传文件时的MIME类型
  • jquery很久以前的服务器
  • Android Studio 将数据发送到 MySql 数据库的问题
  • 与php混淆角度
  • 连接三个表的动态数据透视表
  • Laravel 5 Query Builder不返回任何数据
  • 在YII中使用ffmpeg从mp4视频中获取图像

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华