[英]why my temporary file is not writeable in /tmp folder - linux server(centos)
我正在使用php-export-data.class.php ,其中的临时文件不可写,并引发一些警告
警告:更名(/tmp/exportdatauC7PtH,/report/saleslist.xls):在第60行的/var/www/html/excel/php-export-data.class.php中没有这样的文件或目录
这是我的代码:
$this->tempFilename = tempnam(sys_get_temp_dir(), 'exportdata');
$this->tempFile = fopen($this->tempFilename, "w");
我的60号线是
rename($this->tempFilename, $this->filename);
我尝试将755
和777
权限授予我的/tmp
目录,但该文件未写入。
谢谢
您需要创建所有中间目录。
为了将文件重命名为/tmp/exportdatauC7PtH,/report/saleslist.xls
,首先需要确保目录/tmp/exportdatauC7PtH,/report/
存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.