1

I have a client with a Craft 4 site on GoDaddy. I’m not thrilled with the hosting, but it has been working fine for months/years.

Suddenly, it’s showing an internal server error message on the front-end, and the admin panel.

The exact error in the logs is:

2024-07-02 00:00:00 [web.ERROR] [craft\db\Connection::open] Class "PDO" not found {"memory":13896368}
2024-07-02 00:00:00 [web.ERROR] [craft\base\ApplicationTrait::getIsDbConnectionValid] There was a problem connecting to the database: Craft CMS can’t connect the the database. {"memory":13920368}

There are a few other lines but basically it repeats over and over.

GoDaddy insist it’s a DNS issue :| I’m no expert, but that looks like a DB connection problem to me.

Here’s where I’m confused:

I’ve run the server check: https://github.com/craftcms/server-check and it passes everything.

I’ve also run the db connection test suggested in the Craft troubleshooting guide: https://gist.github.com/mattstein/c4a42e16989bcd488ce969d96fc8598b it comes back with "------------------------------------------------ Database Connection Test PHP 8.3.8 DB driver: mysql ------------------------------------------------ 👍 Connected and found 109 tables."

So the server seems OK, the connection details are fine and the database is accessible, and it was working fine until Friday, when it just broke.

Any suggestions for something I can check next would be gratefully received.

At this point I’m close to just resetting the server and reinstalling the whole thing.

1 Answer 1

2

It sounds like the host switched PHP versions and didn’t enable some of the required modules. See this answer for a way to get them enabled again.

It’s also possible that the PHP version (and therefore the loaded modules) are different for HTTP requests and the CLI. How did you run the server check scripts?

The DB connection test script doesn’t use the PDO driver, internally, so while it does establish that the database is reachable, it doesn't simulate how Craft would actually connect to it.

2
  • Thanks for your answer — because GoDaddy insisted it was a DNS issue I uploaded the server check manually using the file manager in cpanel, then accessed in a browser. So I don’t think that can be it. I also checked the PHP version, noticed that various PDO modules were disabled, and reenabled them, but that didn’t fix it.
    – mitrol
    Commented 2 days ago
  • 1
    Thanks again. I downgraded from 8.3 to 8.2, doing so disabled some modules, so I reenabled them and it all came back up. 🤷🏼
    – mitrol
    Commented 2 days ago

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