sys_get_temp_dir() - 在 windows8 上返回 C:\Windows [英] sys_get_temp_dir() - returns C:\Windows on windows8
本文介绍了sys_get_temp_dir() - 在 windows8 上返回 C:\Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 windows8 上我用 php 5.3 得到了这个:
On windows8 I got this with php 5.3:
echo sys_get_temp_dir();
输出:
C:\Windows
我是不是没听懂或者是一个错误?
Am I not understand something or it is a bug?
UPD
尝试$_ENV
:
<?php
var_export($_ENV);
输出:
array ( )
检查upload_tmp_dir
:
<?php
echo ini_get('upload_tmp_dir');
输出:
C:\Windows\Temp
推荐答案
查看PHP源码,会调用GetTempPath 来确定临时目录.根据文档,windows 目录 C:\Windows 是最后一个失败选项.您应该检查 PHP 或其宿主进程在哪个用户配置文件下运行,也许环境需要一些修复.
Looking at the PHP source, it will call GetTempPath to determine the temp directory. According to the documentation, the windows directory C:\Windows is the last fallthrough option. You should check under which user profile PHP or its host process is running, maybe the environment needs some fixing.
这篇关于sys_get_temp_dir() - 在 windows8 上返回 C:\Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文