ForestMuffin

Roundcube 1.7.6 ‘Class Pdo\Mysql not found’ on PHP 8.3: Fix

Dev Notes3 min read

It isn’t your pdo_mysql extension. If your Roundcube 1.7.6 upgrade on PHP 8.3 dies with Class "Pdo\Mysql" not found, the target vendor/ may be missing symfony/polyfill-php84. Adding that polyfill before running the updater fixed it for one user in the GitHub issue.

The short version, as of November 2026:

composer require symfony/polyfill-php84
bin/update.sh --version=1.7.6

If vendor/ can’t be rsynced, edit composer.json by hand and run composer update instead. That comes from a maintainer’s explanation in the same thread. The issue reports this error during bin/update.sh and in one bin/installto.sh case, and the rest of this post helps you tell which situation you’re in.

What the error means

PHP Fatal error: Uncaught Error: Class "Pdo\Mysql" not found in /var/www/roundcube/program/lib/Roundcube/db/mysql.php:133

This is the error from the GitHub issue report. It appeared while updating to 1.7.6 on PHP 8.3 with pdo_mysql already installed. Your path will differ if Roundcube lives somewhere other than /var/www/roundcube. Look at where the trace points: program/lib/Roundcube/db/mysql.php, not a missing PHP extension.

Two rows compare Roundcube 1.7.6 on PHP 8.3 running against a vendor/ from an earlier release without polyfill-php84, which ends in Class "Pdo\Mysql" not found, with the same code running against an updated vendor/ where the polyfill provides Pdo\Mysql.
The new code fails when the target’s vendor/ was not updated with symfony/polyfill-php84.

That’s the clue. The Pdo\Mysql class was added in PHP 8.4, so PHP 8.3 doesn’t ship it. Roundcube relies on symfony/polyfill-php84 to provide it, and that polyfill only became a Roundcube dependency in 1.7.6.

A vendor/ left over from an earlier release won’t contain it. If the target’s dependencies aren’t updated before update.sh runs, the new code can end up running against the old vendor/ and fail with this error.

How the dependencies got skipped can differ between setups. In one case from the issue, installto.sh treated the install as custom and didn’t sync vendor/. Don’t assume that’s what happened on your system. Step 1 tells you whether the polyfill is actually there.

On PHP 8.4? You probably don’t need the polyfill, because the class is built in. It isn’t confirmed whether 8.4 setups can still hit this error, so if you see it there, start with step 1.

How to fix it

Run everything below in the installation you’re upgrading. Don’t run it in the unpacked 1.7.6 folder. The polyfill has to land in the target, before update.sh runs there, and running composer require in the wrong folder is the easiest way to get this wrong.

Flowchart: check vendor/symfony/ for polyfill-php84. If it is listed, look for another cause. If it is missing, use step 4 when the install was flagged as custom or vendor/ can't be rsynced, and use step 2 otherwise. Both paths end with the step 5 verification.
Step 2 and step 4 are alternatives. Both end with the same verification.

1. Check whether the polyfill is there

cd /var/www/roundcube
ls vendor/symfony/

If polyfill-php84 isn’t listed, go to step 2. If it is listed, this missing-dependency cause is unlikely and you should look for something else.

2. Add the polyfill, then run the updater

This is the shortest path, and it resolved the error for one user in the issue. Install the polyfill first, then run update.sh with --version=1.7.6:

cd /var/www/roundcube
composer require symfony/polyfill-php84
/usr/local/bin/php bin/update.sh --version=1.7.6

Adjust the PHP path to your system. The official docs don’t confirm this fix, so treat it as the first thing to try, not a guaranteed answer.

3. If you used installto.sh, check whether it skipped vendor/

Say you upgraded with bin/installto.sh and vendor/ didn’t change. Check vendor/symfony/ in the target after the run. In the issue, the installation was identified as custom and didn’t receive vendor/ updates. The cause was a non-vanilla, Composer-generated vendor/autoload.php, and the affected setup had the carddav plugin installed through Composer.

Carddav is the only plugin the issue confirms. It also isn’t confirmed how installto.sh decides an install is custom, so don’t assume other plugins behave the same way.

You might be tempted to copy a fresh vendor/ over the flagged install. The sources don’t say what a manual overwrite would break, so back up vendor/ first, then use step 4 instead.

4. Update composer.json by hand when vendor/ can’t be rsynced

The thread concluded that where vendor/ can’t simply be rsynced, you need a manual composer.json update plus a composer update call. This replaces step 2; it doesn’t add to it. If installto.sh flagged your install as custom, use this route. Otherwise step 2 is shorter.

  1. Open composer.json in the target installation.
  2. Add symfony/polyfill-php84 to the require section. No version constraint is confirmed, so I won’t guess one.
  3. Run the update in the same directory:
cd /var/www/roundcube
composer update

If your upgrade didn’t finish, rerun it the way you started it, for example bin/update.sh --version=1.7.6.

5. Verify

A finished upgrade doesn’t prove the polyfill landed. Run ls vendor/symfony/ again and confirm polyfill-php84 is listed. Then retry the upgrade and check whether Class "Pdo\Mysql" not found still appears. If it does and the polyfill is present, the cause is something other than this missing dependency.

Other plugins haven’t been ruled out as triggers for the vendor/ skip. Run this check after every upgrade, not just this one.

Sources

This article was created using generative AI based on publicly available sources.