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
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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
Comment by Eli Schwartz (eschwartz) - Monday, 13 November 2017, 05:21 GMT
  • Field changed: Summary (PDO isn't working even though it is loaded → [php] PDO isn't working even though it is loaded)
  • Field changed: Severity (Critical → Medium)
At the top of every page in this bugtracker:

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.
Comment by Jan de Groot (JGC) - Monday, 13 November 2017, 10:29 GMT
pdo_mysql depends on the mysqlnd module:

#ifdef PDO_USE_MYSQLND
ZEND_MOD_REQUIRED("mysqlnd")
#endif

This isn't documented anywhere though...
Comment by Martin (greencopper) - Monday, 13 November 2017, 20:49 GMT
Eli: It is a critical bug if you're running a PHP system that depends on PDO. Your entire webshop or whatever isn't working. What's wrong with the title? It says exactly what the problem is.

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



Comment by Doug Newgard (Scimmia) - Monday, 13 November 2017, 23:35 GMT
Read the link eschwartz gave you. Nobody cares one bit how much it affects you, the guidelines spell out what severity means.
Comment by Martin (greencopper) - Tuesday, 14 November 2017, 01:04 GMT
I did read that. It doesn't fit "The main functionality of the application does not work" since it isn't just the "main" functionality of PDO that isn't working, it's the entire PDO system that's gone. This is equivalent to a "severe boot failure" if you know anything about running a box with PHP with PDO.
Comment by Doug Newgard (Scimmia) - Tuesday, 14 November 2017, 01:30 GMT
You seriously don't see a difference between a part of a program not working and the entire system not booting?

Follow the rules if you expect to stay here.
Comment by Eli Schwartz (eschwartz) - Tuesday, 14 November 2017, 01:50 GMT
1) Useful bug titles include the name of the package, thereby making the bug searchable using the keywords that people are going to actually, like, search with...

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.
Comment by Pierre Schmitz (Pierre) - Tuesday, 14 November 2017, 17:48 GMT
PDO works fine for me (on several machines including this very bug tracker you are using). How exactly are you able to reproduce this issue?
Comment by knl (knl) - Tuesday, 14 November 2017, 21:04 GMT
Hi Martin

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.
Comment by Martin (greencopper) - Tuesday, 14 November 2017, 23:07 GMT
I am sorry for my misunderstanding.

Please close the report, my mistake.

Loading...