为什么 PHP 在 chmod 777 和 SELinux 禁用的情况下也无法写入?

问题描述 投票:0回答:1

问题

PHP不能写文件。功能 is_writable('/data') 返回 false

详解。

当我试图安装NextCloud,并将它的数据目录设置为------。/data,我遇到了 Can't create or write into the data directory 错误。按照它,我发现 is_writable($dataDir) 失败(/path/to/nextcloud/lib/private/setup.php312)

我已经设定 chmod 777 -R /datachown -R www:www /data 并禁用SELinux。

是否有问题?open_basedir 里面 php.ini,还是其他原因?

平台

  • CentOS 8
  • 用php7.3安装的LNMP。BT-面板
    • nginx 1.61
    • php 7.3
php chmod selinux nextcloud
1个回答
0
投票

我自己解决了这个问题

有很多php.ini文件! 请检查其中是否有包含 open_basedir. 如果 open_basedir 的设置,php的写入权限将被限制。

阅读更多关于 open_basedir

这是个傻瓜问题 :(

© www.soinside.com 2019 - 2024. All rights reserved.