首页 > 数据库技术 > 详细

PHPBB3 Both the database and the directory containing it must be writable -- 含解题过程

时间:2020-12-25 22:46:57      阅读:34      评论:0      收藏:0      [点我收藏+]
解题:我用的是SQLite数据库,原因是没有填对数据库路径,
Database server name: /var/www/html/phpBB3/db

解题过程:

1.Google Both the database and the directory containing it must be writable
发现 https://fossies.org/linux/phpBB/language/en/install.php中有以下内容
‘INST_ERR_DB_NO_WRITABLE‘ => ‘Both the database and the directory containing it must be writable.‘,

2.在安装包目录查找INST_ERR_DB_NO_WRITABLE

grep -ir "INST_ERR_DB_NO_WRITABLE" phpBB3/*
找到:/var/www/html/phpBB3/phpbb/install/helper/database.php

    // Check if SQLite database is writable
    if ($dbms_info[SCHEMA] === sqlite
        && (($this->filesystem->exists($dbhost) && !$this->filesystem->is_writable($dbhost)) || !$this->filesystem->is_writable(pathinfo($dbhost, PATHINFO_DIRNAME))))
    {
        $errors[] = array(
            title =>INST_ERR_DB_NO_WRITABLE,
        );
    }

就以为是填localhost,又以为是填localhost/phpBB3/db 都不对,虽然安装成功,到后面点击ACP访问管理后台时报错:

General Error
SQL ERROR [ sqlite3 ]
no such table: phpbb_config [1]
An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

3.又Google no such table: phpbb_config 没有找到答案.

4.再看database.php这段代码this->filesystem->is_writable($dbhost)
灵机一动,dbhost应该是本地的一个路径,我在phpBB3里新建了一个db目录就可以了.
安装时填写Database server name为/var/www/html/phpBB3/db

技术分享图片

 

 5.大功告成:http://localhost/phpBB3/

技术分享图片 

PHPBB3 Both the database and the directory containing it must be writable -- 含解题过程

原文:https://www.cnblogs.com/v5captain/p/14190794.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!