5

Civi: 4.7.11
Wordpress 4.7.2

Hi, I was working on my database today and munged something up. No problem (I thought)... I did a back up beforehand just in case. Unfortunately, after restoring the database I now get the following when I try to access Civi from the front or back end. WordPress is running fine. (Note: The database restore was a red herring. It was a change of the PHP version at the same time that caused the problem)

Civi was working perfectly so I'm rather baffled as to what the issue would be since it's all the same data as before.

Any suggestions would be appreciated.

Initialization Error
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => simpleHandler
        )

    [code] => -25
    [message] => DB Error: extension not found
    [mode] => 16
    [debug_info] =>  [DB Error: extension not found]
    [type] => DB_Error
    [user_info] =>  [DB Error: extension not found]
    [to_string] => [db_error: message="DB Error: extension not found" code=-25 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [DB Error: extension not found]"]
)

ADD. 1

I've found two mentions of the same error
- CiviCRM Initalization Error: DB Error: extension not found
- https://issues.civicrm.org/jira/browse/CRM-17874

Both refer to the problem being the use of the MySQL extension. I'm a little out of my depth at this point. As far as I can tell there were no changes to the server in the short time between when I made and restored the backup DB.


ADD. 2

As mentioned in my reply to Kainuk below, it turns out the host upgraded the PHP from 5.4 to 7. I don't have shell access, or access to the folders mentioned in the links in my previous addendum, so I'll have to get the host to look at it. Will report back with the results of that. (Turns out I didn't need to go to the host. I was mistaken about where to implement the changes)


ADD. 3

The host CPanel dashboard is still showing the old PHP version. I only discovered the PHP version was changed to 7 by running a phpinfo query.

The problem was resolved by implementing these changes https://issues.civicrm.org/jira/browse/CRM-17874 in /wp-content/uploads/civicrm/civicrm.settings.php

5
  • 1
    The two links you give are not referring to a MySQL extension, but to a PHP extension (namely PEAR). The first gives a hint to force the use of PHP 5 (that PEAR extension). The other proposes to change the PHP driver by changing the MySQL connect string to "mysqli://" (remark the i). Did you try this? Commented Feb 9, 2017 at 11:29
  • 2
    No, I didn't. The server was running PHP 5.4 when I did the install so I was assuming it wouldn't be necessary to force the use of PHP 5. I seem to be a victim of Murphy's Law. I went to double check the PHP version and, sure enough, the host upgraded the PHP to 7.0 after I ran my backup. (sigh)
    – Pennopoly
    Commented Feb 9, 2017 at 13:52
  • 1
    The file where you can change the driver is the civicrm.settings.php file. Are you able to edit this file? Commented Feb 9, 2017 at 14:55
  • 1
    Yes! That did the trick. Thank you so much! (The link above mentioned changing settings in /usr/bin/php. That folder I didn't have access to.)
    – Pennopoly
    Commented Feb 9, 2017 at 15:29
  • Nice, I wrapped everything up in an answer. But you did the research! Commented Feb 9, 2017 at 15:49

1 Answer 1

9

Summarising the above conversation:

  • The upgrade of PHP to version made the PEAR DB extension unavailable. So the exception "DB Error: extension not found" was thrown.
  • Changing to the database connection URL in the civicrm.settings.php using the prefix mysqli solves the problem.
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.