Install bareos-webui on FreeBSD 11.2

47 views
Skip to first unread message

Andreas Balogh

unread,
Oct 1, 2019, 5:08:24 PM10/1/19
to bareos-users
Installing bareos-webui on FreeBSD 11.2 leads to the follwing error message:

Fatal error: Uncaught Error: Call to undefined function _() in /usr/local/www/bareos/module/Application/config/module.config.php:125 Stack trace: #0 /usr/local/www/bareos/module/Application/Module.php(55): include() #1 /usr/local/www/bareos/vendor/zendframework/zend-modulemanager/src/Listener/ConfigListener.php(126): Application\Module->getConfig() #2 [internal function]: Zend\ModuleManager\Listener\ConfigListener->onLoadModule(Object(Zend\ModuleManager\ModuleEvent)) #3 /usr/local/www/bareos/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent)) #4 /usr/local/www/bareos/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('loadModule', Object(Zend\ModuleManager\ModuleEvent), NULL) #5 /usr/local/www/bareos/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(174): Zend\EventManager\EventManager->trigger('loadModule', Object(Zend\ModuleManager\ModuleManager), Object(Zend\ModuleManag in /usr/local/www/bareos/module/Application/config/module.config.php on line 125


Is this an issue with a php library, as described at https://github.com/poweradmin/poweradmin/issues/316

During installation the package manager did install a limited set of php modules, less than given at https://vermaden.wordpress.com/2018/05/01/bareos-backup-server-on-freebsd/

root@bareos:/usr/local/etc/apache24/Includes # pkg install bareos-webui
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 11 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bareos-webui: 18.2.6
        php72-session: 7.2.22
        php72: 7.2.22
        php72-ctype: 7.2.22
        php72-openssl: 7.2.22
        php72-hash: 7.2.22
        php72-json: 7.2.22
        php72-gettext: 7.2.22
        php72-pdo_pgsql: 7.2.22
        php72-pdo: 7.2.22
        php72-iconv: 7.2.22

Number of packages to be installed: 11

Vermaden lists:


pkg install \
  bareos-client bareos-server bareos-webui postgresql95-server nginx \
  php56 php56-xml php56-session php56-simplexml php56-gd php56-ctype \
  php56-mbstring php56-zlib php56-tokenizer php56-iconv php56-mcrypt \
  php56-pear-DB_ldap php56-zip php56-dom php56-sqlite3 php56-gettext \
  php56-curl php56-json php56-opcache php56-wddx php56-hash php56-soap

Any idea how to resolve the issue?

Andreas Rogge

unread,
Oct 2, 2019, 1:17:05 AM10/2/19
to bareos...@googlegroups.com
Am 01.10.19 um 23:08 schrieb Andreas Balogh:
> Installing bareos-webui on FreeBSD 11.2 leads to the follwing error message:
>
> *Fatal error*: Uncaught Error: Call to undefined function _() in
> /usr/local/www/bareos/module/Application/config/module.config.php:125

> *Any idea how to resolve the issue?
I remember cases where php-modules had been installed, but were not
available until the webserver had been restarted. Maybe try this first.

The function _() should be available if php72-gettext is installed.
Could you take a look at phpinfo() and check whether this is the case?

Best Regards,
Andreas



--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: S. Dühr, M. Außendorf, J. Steffens, Philipp Storz

signature.asc

Andreas Balogh

unread,
Oct 2, 2019, 2:10:27 PM10/2/19
to bareos-users
I can see PHP warnings in the apache log:

PHP Warning:  PHP Startup: Unable to load dynamic library 'gettext.so' (tried: /usr/local/lib/php/20180731/gettext.so (C
annot open "/usr/local/lib/php/20180731/gettext.so"), /usr/local/lib/php/20180731/gettext.so.so (Cannot open &
quot;/usr/local/lib/php/20180731/gettext.so.so")) in Unknown on line 0
[more of above for all installed php modules]

When checking directories I find:

root@bareos:/usr/local/lib/php # ll
total 27
drwxr-xr-x  2 root  wheel  24 Oct  1 23:10 20170718/
drwxr-xr-x  2 root  wheel  14 Oct  1 23:03 build/

php.conf reads:

root@bareos:/usr/local/etc # cat php.conf
PHP_VER=72
PHP_VERSION=7.2.22
PHP_SAPI=cli cgi fpm embed
PHP_EXT_INC=pcre spl
PHP_EXT_DIR=20170718
so I am wondering where the apache libphp7.so sources the module dir. I have two PHP shared libraries in the system:

root@bareos:/usr/local # find . -name libphp7.so -ls
122233     5165 -rw-r--r--    1 root wheel 4921120 Sep 27 00:03 ./libexec/apache24/libphp7.so
139772     5689 -rwxr-xr-x    1 root wheel 5520136 Sep  7 03:12 ./lib/libphp7.so

The other instance seems to be incompatible with apache24. When I change httpd.conf to

# LoadModule php7_module        libexec/apache24/libphp7.so
LoadModule php7_module        lib/libphp7.so

I get an error in the apache24 log and it refuses to start.

Performing sanity check on apache24 configuration:
httpd: Syntax error on line 182 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `php7_module' in file /usr/local/lib/libphp7.so: Undefined symbol "php7_module"

This seems to be an apache24/php FreeBSD 11.2 issue, but it also draws bareos into oblivion.

Andreas Balogh

unread,
Oct 2, 2019, 2:17:30 PM10/2/19
to bareos-users
I installed

pkg install mod_php72

which uninstalled mod_php73. Now my apache24 error log is clean.
When calling the bareos webui I now get:

Parse error: syntax error, unexpected '@' in /usr/local/www/bareos/config/autoload/global.php on line 142

Does it ever end?

Andreas Balogh

unread,
Oct 2, 2019, 2:22:46 PM10/2/19
to bareos-users

p...@citylink.dinoex.sub.org

unread,
Dec 10, 2019, 7:04:08 AM12/10/19
to bareos-users
Hey, cool you got that far bro!

So if you made it past that one and another similar one, next corner appear these hot babes:

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/www/bareos/vendor/zendframework/zend-stdlib/src/ArrayObject.php on line 426

Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /usr/local/www/bareos/vendor/zendframework/zend-session/src/Config/SessionConfig.php on line 88

Fatal error: Uncaught Zend\Session\Exception\InvalidArgumentException: 'session.name' is not a valid sessions-related ini setting. in /usr/local/www/bareos/vendor/zendframework/zend-session/src/Config/SessionConfig.php:90 Stack trace: #0 /usr/local/www/bareos/vendor/zendframework/zend-session/src/Config/StandardConfig.php(266): Zend\Session\Config\SessionConfig->setStorageOption('name', 'bareos') #1 /usr/local/www/bareos/vendor/zendframework/zend-session/src/Config/StandardConfig.php(114): Zend\Session\Config\StandardConfig->setName('bareos') #2 /usr/local/www/bareos/module/Application/Module.php(147): Zend\Session\Config\StandardConfig->setOptions(Array) #3 [internal function]: Application\Module->Application\{closure}(Object(Zend\ServiceManager\ServiceManager), 'zendsessionsess...', 'Zend\\Session\\Se...') #4 /usr/local/www/bareos/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(939): call_user_func(Object(Closure), Object(Zend\ServiceManager\ServiceManager), 'zendsessionsess...', 'Zend\\Session\\Se...') in /usr/local/www/bareos/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 946

I found some hints about these in Stackoverflow questions concerning how to learn php, but it doesn't really figure, and anyway I didn't intend to learn php.

But then, I understand that the company wants to make money, and the more errors they have in the code, the more support they can sell.

Reply all
Reply to author
Forward
0 new messages