问题描述
当我在Ubuntu 20.04上使用7.0版本的PHP并尝试打开时:http:// localhost / PHPmyadmin /-然后:HTTP ERROR 500 appers。
- “消息:MysqLi :: real_connect():服务器请求身份验证 客户端未知的方法[caching_sha2_password]“
- “ MysqLi :: real_connect():(HY000 / 2054):服务器请求了 客户端未知的身份验证方法”
enter image description here enter image description here
当我将PHP版本更改为7.4时-一切正常(PHPmyadnim和页面)
我检查了7.0版的日志(tail /var/log/apache2/error.log),但出现错误:
- “ PHP分析错误:语法错误,意外的'const'(T_CONST),/ usr / share / PHP / PHPMyAdmin / MoTranslator / Translator.PHP中第58行的预期变量(T_VARIABLE)
我尝试安装:
sudo apt-get install PHP-mbstring PHP7.0-mbstring PHP-gettext
但是每次我这样做时,我都会得到信息:“无法找到PHP-gettext包”
在PHP 7.4版上,一切正常。但是我想使用7.0版的PHP。
我尝试过:
解决方法
在运行7.1.16之前的PHP版本或7.2.4之前的PHP 7.2时,请将MySQL 8服务器的默认密码插件设置为iter()
,否则即使{ {1}}未使用。
这是因为MySQL 8默认为mainWindow = new BrowserWindow({
icon: './pathTo/myIcon.ico' // <-- this line
});
,这是旧版PHP(mysqlnd)版本无法识别的插件。相反,可以通过在mysql_native_password
中设置The server requested authentication method unknown to the client [caching_sha2_password]
来更改它。 caching_sha2_password
将在以后的PHP版本中得到支持。