它是确定依靠的/ tmp文件夹可写? [英] Is it ok to rely on the writeability of /tmp folder?
问题描述
它是确定假设/ PHP支持/ Apache的临时文件夹中写入任何UNIX系统上?
我在做一个脚本,并要保存在高速缓存tmp文件夹,想知道这是否会导致问题。
Is it ok to assume /tmp folder writable by PHP/Apache on any unix system? I'm making a script and want to save cache in the tmp folder and want to know whether that can cause problems.
推荐答案
这应该没问题。 / tmp目录
由供大家使用。但要小心,这也意味着,任何人都可以阅读您的文件,如果您没有设置特定的权限!
It should be OK. /tmp
is made for everyone to use. But be careful, it also means that anyone can read your files if you don't set specific permissions!
如果您不确定,让你的安装脚本检查 / tmp目录
文件夹,并有可能为用户配置的另一个临时位置。这可能是因为反正不同的用户有不同的需求的最佳选择。例如,考虑与负载平衡服务器用户;她可能想使用这是她所有的主机之间共享文件夹。
If you are unsure, make your installation script check the /tmp
folder and make it possible for the user to configure another temp location. This is probably the best bet anyway because different users have different needs. Consider for example a user with load-balanced servers; she might want to use a folder which is shared between all her hosts.
这篇关于它是确定依靠的/ tmp文件夹可写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!