Uncaught PDOException

I just transferred from Windows Apache MariaDB PHP to Manjaro and the installation as described in Install Apache, MariaDB, PHP (LAMP) 2016 went smoothly.
Alas on running my database module (/srv/ap/ngaro.i) I get an uncaught PDOException:

[Sun Aug 09 08:48:59.116517 2020] [php7:error] [pid 1707] [client] PHP Fatal error: Uncaught PDOException: could not find driver in /srv/ap/ngaro.i:57\nStack trace:\n#0 /srv/ap/ngaro.i(57): PDO->__construct()\n#1 /srv/ap/ngaro.i(72): reflog()\n#2 /srv/http/ap.php(16): include_once('/srv/ap/ngaro.i')\n#3 {main}\n thrown in /srv/ap/ngaro.i on line 57

In other words "Can't find PDO driver"
Is there something I missed in the setup to include PDO interface to MariaDB?

edit: This is the relevant entry in phpinfo();

Maybe this?

% pamac search php73-pdo                                                                                                    ~
php73-pdo_sqlsrv                                                                                                 5.8.1-1  AUR 
    Microsoft SQL Server PDO Drivers for PHP

no... I get nowhere with that... :pensive:

pamac and NOT pacman

It is an aur package :wink:

why want php5.3 ? exists same for php 7.4 in aur :wink:

for @melahi : pacman build php-pdo_sqlsrv

you want what ??? pdo_sqlsrv is for "ms sql" !

run php -i | grep -i pdo for view if pdo and mysql(for mariadb) is enabled :wink:
if is ... sql server is not loaded (by systemd)

yes, I thought that too, but I tried as suggested
That command you suggested confirmed it was not enabled but I've found it now:

in /etc/php/php.ini we have to uncomment the lines:
and maybe two others, but I didn't seem to need them for my app and probably don't need both of those either :blush:

oh... my bad... I thought it was a typo - but I just get "bash:paman: command not found" however... I seem to have fixed it by editing php.ini as described above.

p.s. just a note in case others also have problems with php image handling, besides the pdo support.
The default libraries on Linux seem to be very minimal and you need to install php-gd
sudo pacman -S php-gd

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by