[error] 53158#100708: *1007107 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function Icinga\Web\Controller\mime_content_type() in /usr/local/www/icingaweb2/library/Icinga/Web/Controller/StaticController.php:82 php function "mime_content_type()" is included into sysutils/php{xx}-fileinfo how to reproduce: # php -r 'echo mime_content_type("/etc/motd.template") . "\n";' PHP Fatal error: Uncaught Error: Call to undefined function mime_content_type() in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 how to fix: # pkg install php81-fileinfo # php -r 'echo mime_content_type("/etc/motd.template") . "\n";' text/plain proposed fix (add "fileinfo" on line 20 of Makefile, between dom and gd): --- /usr/ports/net-mgmt/icingaweb2/Makefile.orig 2023-05-13 18:40:19.077005000 +0200 +++ /usr/ports/net-mgmt/icingaweb2/Makefile 2023-05-27 00:01:28.321871000 +0200 @@ -16,9 +16,9 @@ icinga-php-thirdparty${PHP_PKGNAMESUFFIX}>=0.11.0:net-mgmt/icinga-php-thirdparty@${PHP_FLAVOR} \ icingaweb2-module-incubator${PHP_PKGNAMESUFFIX}>=0.18.0:net-mgmt/icingaweb2-module-incubator@${PHP_FLAVOR} USES= php:build,web,flavors shebangfix -USE_PHP= bcmath bitset ctype curl dom gd gettext iconv ldap \ +USE_PHP= bcmath bitset ctype curl dom fileinfo gd gettext iconv ldap \ mbstring mcrypt memcache memcached opcache pdo \ pdo_sqlite posix session simplexml soap sockets sqlite3 xml \ zlib
2023/06/13 10:00:19 [error] 35226#212048: *1925473 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function Cron\filter_var() in /usr/local/www/icingaweb2/icinga-php/library/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php:290 Found this morning, after an icinga2 update and restart. Added php81-filter to fix this one. Should I update my proposed patch to include also this?
proposed fix 2 (include fix 1) add "fileinfo" and "filter" on line 20 of Makefile, between dom and gd: --- /usr/ports/net-mgmt/icingaweb2/Makefile.orig 2023-05-13 18:40:19.077005000 +0200 +++ /usr/ports/net-mgmt/icingaweb2/Makefile 2023-06-13 22:12:27.633857000 +0200 @@ -16,9 +16,9 @@ icinga-php-thirdparty${PHP_PKGNAMESUFFIX}>=0.11.0:net-mgmt/icinga-php-thirdparty@${PHP_FLAVOR} \ icingaweb2-module-incubator${PHP_PKGNAMESUFFIX}>=0.18.0:net-mgmt/icingaweb2-module-incubator@${PHP_FLAVOR} USES= php:build,web,flavors shebangfix -USE_PHP= bcmath bitset ctype curl dom gd gettext iconv ldap \ +USE_PHP= bcmath bitset ctype curl dom fileinfo filter gd gettext iconv ldap \ mbstring mcrypt memcache memcached opcache pdo \ pdo_sqlite posix session simplexml soap sockets sqlite3 xml \ zlib
(In reply to Riccardo Torrini from comment #2) @Riccardo Thanks. I just ran into the same thing. I had already figured php81-filter out, but was still missing fileinfo. My monitoring is working again.
I've got the same thing. Thanks for a quick fix.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=4d94db2cfb7de05761b2df16c1e619cd31cabd83 commit 4d94db2cfb7de05761b2df16c1e619cd31cabd83 Author: Palle Girgensohn <girgen@FreeBSD.org> AuthorDate: 2023-09-28 13:43:10 +0000 Commit: Palle Girgensohn <girgen@FreeBSD.org> CommitDate: 2023-10-03 07:56:21 +0000 net-mgmt/icingaweb2: fix problems running the application Icingaweb failed with stack traces when being accessed due to missing php module dependencies: mime_content_type requires fileinfo. Cron\filter_var requires filter. Also, icingaweb fails at access, missing Locale class, if built without the NLS option. Remove the NLS options, since it seems broken. PR: 271662 net-mgmt/icingaweb2/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
Committed. Thanks!