Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#77244 - [php-legacy] pdo_mysql

Attached to Project: Arch Linux
Opened by Christophe Réquillart (crequill) - Monday, 23 January 2023, 17:56 GMT
Last edited by Pierre Schmitz (Pierre) - Tuesday, 24 January 2023, 14:49 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
With php-legacy and extension pdo_mysql, I get no driver with:
<?php
print_r(PDO::getAvailableDrivers());
?>
returns
array()

Additional info:
* package version(s) : php-legacy 8.1.14-3
* config and/or log files etc. : /etc/php-legacy/php.ini with extension=pdo_mysql and extension=mysqli
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Tuesday, 24 January 2023, 14:49 GMT
Reason for closing:  Not a bug
Comment by Tim (freaz) - Monday, 23 January 2023, 21:16 GMT
I would say the severity should be sort of high for this, considering the number of people who use mysql/mariadb with php who will expect the mysql driver to be built in as it is with the regular php package. For example, I just went through the tedious steps to convert my nextcloud install to use php-legacy as the wiki suggests. And to my surprise, I have no way to connect to the database now.
Comment by Christophe Réquillart (crequill) - Monday, 23 January 2023, 22:23 GMT
Yes I agree with you. I forgot to modify severity. Sorry. Same problem here: my nextcloud cannot connect anymore to the database. And I found this driver problem.
Comment by Markus (wolegis) - Tuesday, 24 January 2023, 08:53 GMT
Package php-legacy indeed contains /usr/lib/php-legacy/modules/pdo_mysql.so. So my guess is that extension_dir is not set (or not set correctly) in php.ini. (Please mind that with the Nextcloud setup as describe in the wiki article FPM uses a dedicated INI file /etc/php-legacy/php-fpm.ini. The instructions in the wiki article correctly state to set extension_dir = "/usr/lib/php-legacy/modules/" there.)
Comment by Christophe Réquillart (crequill) - Tuesday, 24 January 2023, 09:17 GMT
php.ini contains extension_dir = "/usr/lib/php-legacy/modules/" and php-legacy -m returns pdo-mysql as module.
Comment by Markus (wolegis) - Tuesday, 24 January 2023, 09:26 GMT
Next guess: /usr/lib/php-legacy/modules is not within the list of accessible file trees specified by php_value[open_basedir] = ... in /etc/php-legacy/php-fpm.d/nextcloud.conf (or /etc/php-legacy/php-fpm.d/www.conf in case you reused the www.conf as provided by package php-legacy-fpm).
Comment by Markus (wolegis) - Tuesday, 24 January 2023, 09:28 GMT
One more thing: Find out how your FPM is actually started. Look out for option --php-ini.
Comment by Christophe Réquillart (crequill) - Tuesday, 24 January 2023, 11:05 GMT
php_value[open_basedir] is not set for php-legacy.

You are right thanks. The problem was in /etc/systemd/system/php-legacy-fpm.service.d/override.conf, there was:
ExecStart=/usr/bin/php-fpm-legacy --nodaemonize --fpm-config /etc/php-legacy/php-fpm.conf --php-ini /etc/php-legacy/php-fpm.ini

I set it with
ExecStart=/usr/bin/php-fpm-legacy --nodaemonize --fpm-config /etc/php-legacy/php-fpm.conf --php-ini /etc/php-legacy/php.ini

And I get mysql as driver:
Array ( [0] => mysql )

and nextcloud is up. Thanks. Ticket can be close.

Loading...