Driver not found on PDODb on Apache2 PHP 7.4
P粉470645222
P粉470645222 2023-09-15 14:55:04
0
1
550

I use Ubuntu 22.04 and php 7.4. I'm trying to use apache2 to provide a virtual host for my website. The login page can be opened, after we insert the account, the error showscould not find driveron /var/www/website/app/models/PDODb.php on line229 that line is

$this->pdo = new PDO($connectionString, $this->connectionParams['username'], $this->connectionParams['password'], $options);

I have uncommentedextension=pdo_mysqlon php.ini and have restarted apache2. Using php -i | grep pdo_mysqlwill result in this

/etc/php/7.4/cli/conf.d/20-pdo_mysql.ini, API Extensions => mysqli,pdo_mysql pdo_mysql pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock

This is my website.conf

 ServerName localhost ServerAlias localhost ServerAdmin webmaster@localhost DocumentRoot /var/www/website DirectoryIndex /index.php index.php /index.html index.html  AllowOverride All Require all granted  RewriteEngine on ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined 

This is the config.php I use to connect to the database define("DB_HOST", "127.0.0.1");

define("DB_USERNAME", "root"); define("DB_PASSWORD", "root123"); define("DB_NAME", "db_website"); define("DB_TYPE", "mysqli"); define("DB_PORT", ""); define("DB_CHARSET", "utf8");

I have tried following this question but it still gives me the same result. what do I do?

P粉470645222
P粉470645222

reply all (1)
P粉308089080

Just changedefine("DB_TYPE", "mysqli");todefine("DB_TYPE", "mysql");because I only got mysql_pdo

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!