Check mysql extension on install (for PHP7) #479

Closed
opened 2026-10-05 00:00:32 +02:00 by adam · 3 comments
Owner

It seems that piwigo is making use of mysql_* functions a lot. However, this has been deprecated in php7, and instead mysqli_* is supposed to be used.

This prevents installation with php7, as it obviously fails to connect to the mysql database because the function mysql_connect() isn't defined.

It seems that piwigo is making use of mysql_\* functions a lot. However, this has been deprecated in php7, and instead mysqli_\* is supposed to be used. This prevents installation with php7, as it obviously fails to connect to the mysql database because the function mysql_connect() isn't defined. <!-- github-sync-id:169798233 -->
adam closed this issue 2026-10-05 00:00:32 +02:00
Author
Owner

Turns out that it falls back to mysql_* when mysqli isn't enabled, which was the case (I forgot to restart the php daemon). However, piwigo still shouldn't fall back to mysql_* when running on php7 anyhow.

Turns out that it falls back to mysql_\* when mysqli isn't enabled, which was the case (I forgot to restart the php daemon). However, piwigo still shouldn't fall back to mysql_\* when running on php7 anyhow. <!-- github-comment-id:238118718 -->
Author
Owner

OK @DrLuke so you suggest that we change https://github.com/Piwigo/Piwigo/blob/master/install.php#L136 to include additional check on PHP version : "die" if php_version>7 and mysqli not loaded.

OK @DrLuke so you suggest that we change https://github.com/Piwigo/Piwigo/blob/master/install.php#L136 to include additional check on PHP version : "die" if php_version>7 and mysqli not loaded. <!-- github-comment-id:238607325 -->
Author
Owner

It seems to be the correct. However I'm not a php developer, so take my opinion with some salt.

It seems to be the correct. However I'm not a php developer, so take my opinion with some salt. <!-- github-comment-id:238652878 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#479