解决Ubuntu下PHP报错could not find driver - 面板phpinfo中PDO drivers > no value的问题
Posted Rudon滨海渔村
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决Ubuntu下PHP报错could not find driver - 面板phpinfo中PDO drivers > no value的问题相关的知识,希望对你有一定的参考价值。
错误提示
#0 [10501]PDOException in PDOConnection.php line 796
could not find driver
解决步骤
- 确保已经装好mysql并且正在运行
Ubuntu 20.04 从零开始安装MySQL 8.0并重置root密码_Rudon滨海渔村的博客-CSDN博客 - 确保已经装好php7.4-mysql扩展
php -v
sudo apt-get install php7.4-mysql - 确保php.ini已启用pdo
locate php.ini
sudo nano /etc/php/7.4/fpm/php.ini
启用以下
extension=pdo_firebird
extension=pdo_mysql
extension=pdo_oci
extension=pdo_odbc
extension=pdo_pgsql
extension=pdo_sqlite
保存 - 重启web服务器(apache或者nginx)
service nginx restart - php -m | grep -i pdo
PDO
pdo_mysql - phpinfo()中依然是PDO drivers > no value,我们先尝试重试自己的开发站点
- 刷新,没提示pdo错误了,搞定(算是。。。)
以上是关于解决Ubuntu下PHP报错could not find driver - 面板phpinfo中PDO drivers > no value的问题的主要内容,如果未能解决你的问题,请参考以下文章
Ubuntu下TensorFlow报错:Could not load dynamic library ‘libcudnn.so.8‘; dlerror: libcudnn.so.8: cannot..
Ubuntu下cmake报错:Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
Ubuntu下cmake报错:Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
Ubuntu下cmake报错:Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
报错 could not find php_pdo或者driver
Ubuntu 22.04 解决 使用 Qt报错:qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in ““ even...