首页 > 解决方案 > PDO:在 localhost ubuntu 18.04 上找不到驱动程序

问题描述

只是在 ubuntu 18.04、php7.2 和 Mysql Server 版本上进行简单的 PDO 测试:5.7.24-0ubuntu0.18.04.1(Ubuntu): http://localhost/gino/test_pdo/给了我一个错误“找不到驱动程序” .

I have installed all the appropiate files eg:


  sudo apt-get install php7.2-mysql
  sudo phpenmod pdo_mysql
  sudo service apache2 restart 

    I have also deleted the ; from php.ini file eg:

    ;extension=pdo_firebird
     extension=pdo_mysql
     ;extension=pdo_oci

Also the phpinfo.php file DOES NOT SHOW PDO support for mySQL.
I am at a loss on how to fix this  error "could not find driver"  that shows up on the browser. As you can see from above in the php.ini file shows that the PDO module  is there BUT not in the phpinfo.php file.

标签: pdofinddriverphpinfo

解决方案


推荐阅读