php

database

PHP錯誤:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

升級 文件中 sta 否支持 sha2 authent lte 子句 bubuko 使用PHP連接MySQL 8的時候,可能會發生如標題所示的錯誤: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client 發生這種錯誤,是由於MySQL 8默認使用了新的密碼驗證插件:caching_sha2_password,而之前的PHP版本中所帶的mysqlnd無法支持這種驗證。解決這個問題,有兩種辦法。 一種辦法是升級PHP支持MySQL 8的新驗證插件。 PHP 7.2.8和PHP 7.1.20已經可以支持caching_sha2_password,直接連接MySQL 8。 截止PHP 7.0.31和PHP

By ipstor

mysql

关闭 PHP 提示的方法

Notice: Undefined variable: content in E:\Server\vhosts\www.lvtao.net\libs\template.core.php on line 557 进入网站会出现大量类似下面的提示,但是可以正常显示和运行 Notice: Use of undefined constant ctbTitle – assumed 'ctbTitle' in d:\ctb1.5\ctb\include\config.php on line 23… 答案:这些是 PHP 的提示而非报错,PHP 本身不需要事先声明变量即可直接使用,但是对未声明变量会有提示。一般作为正式的网站会把提示关掉的,甚至连错误信息也被关掉

By ipstor