PHP Fatal error: Class "IPLib\Factory" not found

Hi, I’ve been having problems with my email since this morning. Yesterday, May 28, 2026, my SSL certificate expired. I generated a new one overnight, but it had some naming issues.

What I did:

  1. In the WEB GUI, after logging in, I added a new domain in the Domains tab under the name webmail.prospect.pl. After adding it, I checked the checkbox:

    image

  2. I deleted the added webmail domain.

  3. I went to the Mail tab and clicked Edit next to my email. I unchecked Enable SSL, saved it, edited it again, checked Enable SSL + Use Let’s Encryp, and saved it. My email is back up – I can log in to Roundcube.

After all this, I’m now having trouble opening emails containing any images – I get the error:

"Oops… something went wrong!
An internal error has occurred. Your request cannot be processed at this time.

For administrators: Please check the application and/or server error logs for more information."

Using AI help, I managed to extract something like this from the logs (/var/log/apache2/error.log): “PHP Fatal error:
Uncaught Error: Class “IPLib\Factory” not found
in /var/lib/roundcube/program/lib/Roundcube/rcube_utils.php:438”

How do I fix this?

Hestia Control Panel v1.9.5

Use these commands (if your administration user is not admin, replace it with the right user):

v-add-user-composer admin

If it is not installed, the command will install it for the admin user and if you had it already installed, you will be informed. So, now that it is installed you can update composer packages using the full path to composer.

cd /var/lib/roundcube/
COMPOSER_ALLOW_SUPERUSER=1 /home/admin/.composer/composer -n update

After this i have:

Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.0”.

on main webmail site

What’s your default PHP version?

php -v

Have been facing the same issue after upgrading HestiaCP to 1.9.5 / Roundcube 1.6.15. Is there any safe workaround for production servers?

I’m a bit concerned that running a full composer update inside /var/lib/roundcube may update more dependencies than just mlocati/ip-lib.

php -v
PHP 8.4.21 (cli) (built: May 14 2026 15:47:48) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.21, Copyright (c) Zend Technologies
with Zend OPcache v8.4.21, Copyright (c), by Zend Technologies

Show the entire output of:

cd /var/lib/roundcube/
COMPOSER_ALLOW_SUPERUSER=1 /home/admin/.composer/composer -n update

Yes, it will do. But should be safe.

Backup the dir and the roundcube db and if something goes wrong you can recover it.

I added the file to the directory:

/home/MY-USERNAME/conf/mail/MY_DOMAIN/apache2.ssl.conf_php

the file contents are as follows:

<FilesMatch .php$>
SetHandler “proxy:unix:/run/php/php8.4-fpm.sock|fcgi://localhost”

Is this way of solving the problem ok?

You should remove this file:

No.

To recreate the mail conf, you should run:

v-rebuild-mail-domain USERNAME MY_DOMAIN

And after that:

systemctl restart nginx apache2

after this i have the same issue:

PHP Fatal error:
Composer detected issues in your platform:
Your Composer dependencies require a PHP version “>= 8.1.0”.
You are running 8.0.25.

I’m having the same issue with Hestia v1.9.5, Nginx and PHP 8.0 on Debian 12.14 (x86_64). In /var/log/roundcube/errors.log, I can see an error that has been recurring since today:

[29-May-2026 10:28:46 UTC] PHP Fatal error:  Uncaught Error: Class "IPLib\Factory" not found in /var/lib/roundcube/program/lib/Roundcube/rcube_utils.php:438
Stack trace:
#0 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(396): rcube_utils::is_local_url()
#1 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(314): rcube_washtml->wash_uri()
#2 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(642): rcube_washtml->wash_attribs()
#3 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#4 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#5 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#6 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#7 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#8 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#9 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#10 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#11 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(624): rcube_washtml->dumpHtml()
#12 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(621): rcube_washtml->dumpHtml()
#13 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(661): rcube_washtml->dumpHtml()
#14 /var/lib/roundcube/program/lib/Roundcube/rcube_washtml.php(730): rcube_washtml->dumpHtml()
#15 /var/lib/roundcube/program/actions/mail/index.php(1004): rcube_washtml->wash()
#16 /var/lib/roundcube/program/actions/mail/index.php(1053): rcmail_action_mail_index::wash_html()
#17 /var/lib/roundcube/program/actions/mail/show.php(738): rcmail_action_mail_index::print_body()
#18 /var/lib/roundcube/program/include/rcmail_output_html.php(1484): rcmail_action_mail_show::message_body()
#19 [internal function]: rcmail_output_html->xml_command()
#20 /var/lib/roundcube/program/include/rcmail_output_html.php(1322): preg_replace_callback()
#21 /var/lib/roundcube/program/include/rcmail_output_html.php(825): rcmail_output_html->parse_xml()
#22 /var/lib/roundcube/program/include/rcmail_output_html.php(654): rcmail_output_html->parse()
#23 /var/lib/roundcube/program/actions/mail/show.php(164): rcmail_output_html->send()
#24 /var/lib/roundcube/program/include/rcmail.php(282): rcmail_action_mail_show->run()
#25 /var/lib/roundcube/index.php(278): rcmail->action_handler()
#26 {main}
  thrown in /var/lib/roundcube/program/lib/Roundcube/rcube_utils.php on line 438

I hope this helps.
Thanks!

@screatius

Change default php to 8.4 or at least to 8.1 and follow these instructions:

Install composer for administrator user, if the user is not admin replace it with the right user.

v-add-user-composer admin

If it is not installed, the command will install it for the admin user and if you had it already installed, you will be informed. So, now that it is installed you can update composer packages using the full path to composer.

cd /var/lib/roundcube/
COMPOSER_ALLOW_SUPERUSER=1 /home/admin/.composer/composer -n update

the issue with roundcube requiring php >=8.1 appears after the composer update.
the php version used to actually run roundcube afaik depends on the version the main domain uses here. so if your website still uses 7.4 or 8.0 this is something, that might not easily be switched upwards.

in this case using the composer update might not be the best approach…

roundcubes php version needs to be decoupled from the main websites php version to properly work then.

one more thing regarding this: I also found a very legacy install, where prefork is still in use for one old php version and it seems that roundcube defaults to that in this case. also something to rather avoid updating roundcube to a newer version, that requires php8.1 and newer…

@falzo After updating the PHP version, I’ll only leave one version available. Would that be a solution?

@sahsanu So is it the same problem? I’ve switched to PHP 8.4 and have been informed

Composer already available

The error persists. It throws an error when opening certain messages. I’ll keep an eye out for any suggestions.

Thanks for your time.

you still need to run the update in /var/lib/roundcube via composer, so it can pull in the missing library like @sahsanu mentioned earlier. if you are on at least php 8.1 by then for everything, this should fix the issue.

if you depend on some older php version and/or have some weird old legacy setup with apache prefork still alive, you’d rather restore the roundcube folder from a backup. that worked for my case as well :wink:

That’s all sorted. I was in such a rush that I missed sahsanu’s last command… Thanks for your time!