PHP tmpfile() returns false

瘦欲@ 提交于 2019-11-28 11:25:13

tmpfile() returns false if it is unable to create the temporary file. Make sure your tmp folder is writable and try and check what sys_get_temp_dir() function returns.

It might be a problem with permissions. Use sys_get_temp_dir() to see where the temp file will be created and make sure php has access to write there.

First, enable all PHP warnings to see if it is telling you something.

Second, check your temp folder and make sure PHP has write access to it. It's possible that certain "safe mode" restrictions (base dirs, etc) are preventing access.

In my case, the folder it was trying to create the file in had temp files ranging all the way up to tmpFFFF.tmp. After moving those temp files away from the folder, it started back at tmp1.tmp.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!