Roundcube Community Forum

Release Support => Pending Issues => Topic started by: cbrace on August 03, 2023, 02:23:22 PM

Title: FreeBSD php81-filter - undefined function error
Post by: cbrace on August 03, 2023, 02:23:22 PM
Hi all,

On my FreeBSD VPS (v13.2) I upgraded PHP from v8.0 to v8.1. To update my roundcube installation, I deleted the roundecube-php80 flavor and installed the roundecube-php81 pkg. That deleted the php80 dependencies and installed the necessary php81 equivalents.

Unfortunately, something broke roundcube. I now see the following error in /var/log/httpd-error.log:

[php:error] [pid 22356] [client ##.###.####.###] PHP Fatal error:  Uncaught Error: Call to undefined function filter_var() in /usr/local/www/roundcube/program/lib/Roundcube/bootstrap.php:49\nStack trace:\n#0 /usr/local/www/roundcube/program/include/iniset.php(78): require_once()\n#1 /usr/local/www/roundcube/index.php(40): require_once('/usr/local/www/...')\n#2 {main}\n  thrown in /usr/local/www/roundcube/program/lib/Roundcube/bootstrap.php on line 49

A websearch returns a single hit here, posted by someone encountered the same error message a couple of years ago: Call to undefined function filter_var() (https://www.roundcubeforum.net/index.php?topic=28657.0)

There was one reply:
QuoteThis function is part of php-filter extension which is usually enabled. You're the first person with this disabled/not-installed. I guess, we should mention that in the INSTALL file.

I definitely have this installed:
$ pkg info php81-filter
php81-filter-8.1.20
Name           : php81-filter
Version        : 8.1.20
Installed on   : Thu Jul 27 17:12:30 2023 CEST
Origin         : security/php81-filter


Double-checked, it's enabled in httpd.conf
LoadModule filter_module libexec/apache24/mod_filter.so

apache sees it:
$ sudo apachectl -M|grep filter
filter_module (shared)


Running Apache24 v2.4.57_1

I tried asking about this in the FreeBSD forum (https://forums.freebsd.org/threads/roundcube-php81-php81-filter-error-msg.89777/) but no luck there. Really hope someone here has some ideas for me to try.

TIA




Title: Re: FreeBSD php81-filter - undefined function error
Post by: anarrov on August 12, 2023, 05:29:56 PM
I have a similar configuration and faced the same problem. Help greatly appreciated!
Title: Re: FreeBSD php81-filter - undefined function error
Post by: cbrace on August 13, 2023, 04:20:07 AM
Thank you for "bumping" this topic. Really really hope we can solve this soon.
Title: Re: FreeBSD php81-filter - undefined function error
Post by: SKaero on August 14, 2023, 09:07:22 AM
You may have better luck asking this on a FreeBSD forum since this is really a PHP packaging problem not a Roundcube problem. According to the PHP documentation the filter extension is enabled by default https://www.php.net/manual/en/filter.installation.php so for some reason the FreeBSD package is disabling it.
Title: Re: FreeBSD php81-filter - undefined function error
Post by: cbrace on August 14, 2023, 11:49:32 AM
Solved! If anyone else running FreeBSD encounters this error, the solution is in this thread on the FreeBSD forum: roundcube-php81 + php81-filter error msg (https://forums.freebsd.org/threads/roundcube-php81-php81-filter-error-msg.89777/)