PHP file_exists 仅适用于 root :root

标签 php linux centos plesk file-exists

if(file_exists( $_SERVER['DOCUMENT_ROOT'] . "/index.html")) echo '文件存在';

当文件的所有者和组设置为 root:root 时,仅返回“文件存在”。如果我将其更改为hostingacc:psacln 或hostingacc:psaserv,它将不再起作用。

请问有办法解决吗?

最佳答案

更改根目录的所有者。

chown -r hostingacc:psacln .

关于PHP file_exists 仅适用于 root :root,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22860513/

相关文章:

php - PDO,在我准备好的陈述中找不到问题

c - linux fcntl 文件锁定超时

apache - 在 Centos 上颠覆失败

PHP:如何在插入语句中包含第一个数字零

php - 使用 fetch/array 时出现 "mysqli_fetch_array() expects parameter 1"错误

php - htaccess 多 URL 变量干净的 URL

linux - 使用写权限挂载vfat

linux - linux 变量 $BASH_SUBSHELL 与 $SHLVL 之间的区别

ldap - 尝试在 CentOS 5.4 上使用 LDAP 配置 samba 域 Controller 时出错

linux - GIT 忽略 commit-msg 钩子(Hook)