If you run phpinfo() on web version of your project there mustn't be cli configuration. There must be folder /etc/php/7.0/apache/conf.d there is a list of loaded php modules . You can try to copy from /etc/php/7.0/mods-available/mysqli.ini to /etc/php/7.0/apache2/conf.d/ .But better to use symlinks. Also check php(your version)-mysl package installed. Or ls /etc/php/7.0/mods-available/ there must be mysqli.ini or similar.
could not find driver exception after upgrading Ubuntu to 17
I have a VPS hosting my laravel project. I upgraded the sever from Ubuntu 16 to 17 and had to completely uninstall mysql and all mysql clients to get mysql working from the command line. My laravel project is located in the /var/www/html/my-project-name directory. When I try to navigate to it from the web, I get a (PDOException could not find driver) exception. If I run php artisan server and view the project, I am able to connect and use the site normally.
I added phpinfo() to my project and I found the Loaded Configuration File is /etc/php/7.0/cli/php.ini. As other suggested, I added extension=mysql.so to that file. Still doesn't work even after restarting apache.
php -v PHP 7.0.18-0ubuntu0.17.04.1 (cli) (built: Apr 26 2017 23:59:48) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.18-0ubuntu0.17.04.1, Copyright (c) 1999-2017, by Zend Technologies
mysql --version mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper
Please or to participate in this conversation.