Author Topic: FreeBSD php81-filter - undefined function error  (Read 2178 times)

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
FreeBSD php81-filter - undefined function error
« 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:

Code: [Select]
[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()

There was one reply:
Quote
This 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:
Code: [Select]
$ 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
Code: [Select]
LoadModule filter_module libexec/apache24/mod_filter.so
apache sees it:
Code: [Select]
$ sudo apachectl -M|grep filter
 filter_module (shared)

Running Apache24 v2.4.57_1

I tried asking about this in the FreeBSD forum but no luck there. Really hope someone here has some ideas for me to try.

TIA





Offline anarrov

  • Newbie
  • *
  • Posts: 1
Re: FreeBSD php81-filter - undefined function error
« Reply #1 on: August 12, 2023, 05:29:56 PM »
I have a similar configuration and faced the same problem. Help greatly appreciated!

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Re: FreeBSD php81-filter - undefined function error
« Reply #2 on: August 13, 2023, 04:20:07 AM »
Thank you for "bumping" this topic. Really really hope we can solve this soon.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: FreeBSD php81-filter - undefined function error
« Reply #3 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.

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Re: FreeBSD php81-filter - undefined function error
« Reply #4 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