FS#56307 - [php] PDO isn't working even though it is loaded
Attached to Project:
Arch Linux
Opened by Martin (greencopper) - Monday, 13 November 2017, 00:59 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 15 November 2017, 01:59 GMT
Opened by Martin (greencopper) - Monday, 13 November 2017, 00:59 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 15 November 2017, 01:59 GMT
|
Details
Description:
It seems like PDO isn't getting loaded even though it is enabled. Error message: "Could not find driver" Additional info: * package version(s) PHP 7.1.11 * config and/or log files etc. So in php.ini I have got: extension=pdo_mysql.so # php -i | grep PDO PDO PDO support => enabled PDO drivers => mysql PDO Driver for MySQL => enabled # php -m PDO pdo_mysql Steps to reproduce: Install nginx, php-fpm and mariadb and test a PDO DB connection. The same error appears if you simply run the PHP internal server without nginx and php-fpm. |
This task depends upon
Closed by Doug Newgard (Scimmia)
Wednesday, 15 November 2017, 01:59 GMT
Reason for closing: Not a bug
Additional comments about closing: Likely setting issue
Wednesday, 15 November 2017, 01:59 GMT
Reason for closing: Not a bug
Additional comments about closing: Likely setting issue
Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines
This is not a critical bug, and the bug title was not useful.
#ifdef PDO_USE_MYSQLND
ZEND_MOD_REQUIRED("mysqlnd")
#endif
This isn't documented anywhere though...
Jan: Thanks, but PHP is build with "mysqlnd" on Arch. From phpinfo:
--with-pdo-mysql=shared,mysqlnd
which is documented here: http://php.net/manual/en/mysqlnd.install.php
Follow the rules if you expect to stay here.
2) As Scimmia said, the bug reporting guidelines exist for a reason (in order to help the developers keep an eye on what the developers consider high-priority bugs, because Arch Linux does not, in fact, revolve around your "webshop or whatever") and they are non-optional and they are very much not ambiguous. Using lawyer words to justify your use case does not help you unless, in fact, PHP+PDO is what you use to boot your kernel from bare metal. And that would be a very very very odd mkinitcpio hook.
You installation shows that PDO is loaded otherwise it wouldn't be enabled:
# php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => mysql
PDO Driver for MySQL => enabled
So there is nothing wrong with that.
The error message you're getting is about your PDO attributes, specifically about the database driver, so you need to fix your settings. It has to be set to "mysql" and nothing else, so check for typos.
Martin, the change of the bug report severity from critical to medium is "wrong" from a PHP stand point, it should be high, but the bug reports are *not* from a PHP stand point, it's from the Arch Linux system stand point. So PHP not working is a "A non-essential functionality" to an Arch Linux system.
Please close the report, my mistake.