php:获取tmp大小
如何获取 tmp 大小
我的代码
filesize('/tmp/phpn3jaaQ');
错误
PHP 警告:filesize() [function.filesize]:安全模式限制生效。不允许uid为524的脚本访问/home/script/file.php第2行中uid 0拥有的/tmp
how to get tmp size
my code
filesize('/tmp/phpn3jaaQ');
error
PHP Warning: filesize() [function.filesize]: SAFE MODE Restriction in effect. The script whose uid is 524 is not allowed to access /tmp owned by uid 0 in /home/script/file.php on line 2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法在文件的安全模式下使用文件处理/管理功能不属于与脚本相同的 UID。
关闭安全模式,您的代码应该可以工作。
编辑:澄清了先前有关文件处理的声明。
另请注意,自 PHP 5.3 起,安全模式已被弃用,这意味着它在未来版本中将不可用。您应该避免使用它,当然也不要依赖它。
You can't use file handling / management functions in safe mode for files not owned by the same UID as the script.
Turn off safe mode and your code should work.
Edit: Clarified previous statement regarding file handling.
Another note, safe mode is deprecated as of PHP 5.3, meaning it will not be available in a future version. You should avoid using it and certainly not rely on it.