Typecho在PHP7以上版本中出现"Database Server Error"错误的解决办法
在将本博的Typecho程序,切换PHP7.0以上版本的时候,页面出现 "Database Server Error" 的错误问题。查阅资料发现,可能是Typecho不兼容PHP7.0版本的问题,因为服务器上有个项目部署的PHP5.6环境,所以本博一直用的PHP5.6,目前发现这个问题,就搜索了一下,确有解决办法。
config.inc.php可以看到问题了。直接在config.inc.php文件中找到:
$db = new Typecho_Db('Mysql', 'typecho_');修改成:
$db = new Typecho_Db('Pdo_Mysql', 'typecho_');替换后,刷新前台、后台均正常使用。
Copyright Notice: This article is an original work. Copyright belongs to A君网志. Please contact the author for permission before reprinting.
Article URL: https://nipang.cn/typecho_database_server_error.html
If you have any questions or concerns about this article, feel free to leave a comment. I will try my best to respond as soon as possible.