FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.14k stars 222 forks source link

Fatal error: Uncaught Error: Call to undefined function _() in /var/www/fog/commons/init.php:439 #483

Closed djagoo closed 2 years ago

djagoo commented 2 years ago

After changing to dev-branch for updating on Ubuntu 20.04 LTS with php8.1 installed I get this error:

May 22 13:03:36 srv-1634713623 env[4659]: Fatal error: Uncaught Error: Call to undefined function _() in /var/www/fog/commons/init.php:439
May 22 13:03:36 srv-1634713623 env[4659]: Stack trace:
May 22 13:03:36 srv-1634713623 env[4659]: #0 /var/www/fog/commons/init.php(306): Initiator::_extCheck()
May 22 13:03:36 srv-1634713623 env[4659]: #1 /var/www/fog/commons/base.inc.php(46): Initiator::startInit()
May 22 13:03:36 srv-1634713623 env[4659]: #2 /opt/fog/service/lib/service_lib.php(22): require('/var/www/fog/co...')
May 22 13:03:36 srv-1634713623 env[4659]: #3 /opt/fog/service/FOGMulticastManager/FOGMulticastManager(25): require('/opt/fog/servic...')
May 22 13:03:36 srv-1634713623 env[4659]: #4 {main} thrown in /var/www/fog/commons/init.php on line 439
May 22 13:03:36 srv-1634713623 systemd[1]: FOGMulticastManager.service: Main process exited, code=exited, status=255/EXCEPTION

As far as I checked, all necessary extensions are installed and activated.

A search for "function _()" pointed me in the direction of some errors related to gettext but gettext is installed and activated too.

Sebastian-Roth commented 2 years ago

@djagoo Sure you mean Ubuntu 20.04 not 22.04? Just asking because PHP 8.1 is default in 22.04 while Ubuntu 20.04 came with PHP 7.4. Manually switching PHP versions can cause any kind of trouble.

Have you made sure php8.1-gettext is installed?

djagoo commented 2 years ago

@Sebastian-Roth Of course, you're right, its Ubuntu 22.04. There is no php8.1-gettext in the repos. Gettext is in the php8.1-common which is installed and gettext is activated in the php.ini. phpinfo() is showing gettext as activated.

Additionally I installed php-php-gettext but this didn't help either.

Sebastian-Roth commented 2 years ago

@djagoo Somehow lost track of this. Did you get this solved or is it still an issue?

Sebastian-Roth commented 2 years ago

@djagoo Going to close this topic now as I have tested on Ubuntu 22.04 lately and did not run into this at all. Please feel free to re-open in case you still have the same issue.

While it does not solve the exact issue you reported you might still be interested to read this topic in case switching the FOG web UI to another language doesn't work for you: https://forums.fogproject.org/topic/16466/changing-language