Owncloud解决方案-owncloud Can't create or write into the data directory.docx
安装owncloud时发生以下报错: Can't create or write into the data directory /data/owncloud 请确保文件根目录下包含一个名为“.ocdata”的文件 Data directory *** not writable by owncloud 如下图:
问题分析 检查php error log,发现存在以下错误日志 Message: is_dir(): open_basedir restriction in effect. File(/mnt/web_site_log//) is not within the allowed path(s): (/vagrant/vbee2:/tmp/:/proc/)
message":"realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/d/:/tmp/:/proc/) at /home/d/lib/private/Files/Storage/#365"} 提取关键信息,应该是open_basedir设置问题,open_basedir限制了PHP能操作的目录。 解决方法 将PHP需要操作的目录加入到open_basedir中, 我使用的是LNMP环境,故以nginx为例来写解决办法。
fastcgi fastcgi_param vim /usr/local/nginx/conf/ 找到open_basedir所在行,修改或添加成以下代码 # set php open_basedir fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; #这里用$document_root是一种取巧的方法,也可以设置绝对路径
注意:对于将owncloud数据文件保存在网站目录以外的路径,需要加上数据文件的路径!!!
Owncloud解决方案-owncloud Can't create or write into the data directory 来自淘豆网www.taodocs.com转载请标明出处.