[ZBX-12674] PHP Fatal error: Uncaught Error: Call to undefined function mb_strlen Created: 2017 Sep 04  Updated: 2017 Sep 26  Resolved: 2017 Sep 12

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.0.10
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Ilya Ableev Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File mbstring_in_setup.png    
Sprint: Sprint 16

 Description   

Installed zabbix frontend on minimal ubuntu setup with no php libs.
Got empty 500 page without any info.
Logs:

[error] 22244#22244: *16 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function mb_strlen() in /opt/zabbix/frontends/3.0.10/include/classes/user/CProfile.php:330
Stack trace:
#0 /opt/zabbix/frontends/3.0.10/include/classes/user/CProfile.php(214): CProfile::checkValueType('index.php', 3)
#1 /opt/zabbix/frontends/3.0.10/include/menu.inc.php(389): CProfile::update('web.menu.login....', 'index.php', 3)
#2 /opt/zabbix/frontends/3.0.10/include/page_header.php(127): zbx_construct_menu(Array, Array, Array)
#3 /opt/zabbix/frontends/3.0.10/include/views/general.login.php(29): require_once('/opt/zabbix/fro...')
#4 /opt/zabbix/frontends/3.0.10/include/classes/mvc/CView.php(139): include('/opt/zabbix/fro...')
#5 /opt/zabbix/frontends/3.0.10/index.php(120): CView->render()
#6 {main}
  thrown in /opt/zabbix/frontends/3.0.10/include/classes/user/CProfile.php on line 330" while reading response header from upstream, client: 192.168.1.2, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "192.168.1.2"

I think, it would be better if users can see error about missing mb_strlen right on web page (maybe on the checklist page?).

Sorry if it's duplicate, couldn't find actual one.



 Comments   
Comment by Ilya Ableev [ 2017 Sep 04 ]

Next error, after logging in

[error] 22244#22244: *29 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function bcadd() in /opt/zabbix/frontends/3.0.10/include/classes/db/DB.php:170
Stack trace:
#0 /opt/zabbix/frontends/3.0.10/include/classes/db/DB.php(136): DB::refreshIds('auditlog', 1)
#1 /opt/zabbix/frontends/3.0.10/include/classes/db/DB.php(421): DB::reserveIds('auditlog', 1)
#2 /opt/zabbix/frontends/3.0.10/include/audit.inc.php(120): DB::insert('auditlog', Array)
#3 /opt/zabbix/frontends/3.0.10/include/classes/user/CWebUser.php(71): add_audit_ext(3, 0, '1', '', NULL, NULL, NULL)
#4 /opt/zabbix/frontends/3.0.10/index.php(69): CWebUser::login('Admin', 'zabbix')
#5 {main}
  thrown in /opt/zabbix/frontends/3.0.10/include/classes/db/DB.php on line 170" while reading response header from upstream, client: 192.168.1.2, server: _, request: "POST /index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "192.168.1.2", referrer: "http://192.168.1.2/"

It is possible to handle fatal error and print "human"-like messages.

Comment by Valdis Murzins [ 2017 Sep 11 ]

Normally you should not be able to pass frontend setup without having mbstring module installed.

You had no problems in this setup page?

Comment by Ilya Ableev [ 2017 Sep 11 ]

You can, if you have zabbix_conf.php deployed before

Comment by Valdis Murzins [ 2017 Sep 12 ]

As per frontend requirements you should have php-mbstring module enabled.
On new system it is advised to use frontend setup, to automatically check, that all requirements are met.
You also are seeing this error in webserver logs.
It should be enough to identify the problem.

Comment by Valdis Murzins [ 2017 Sep 26 ]

Additionally I want to mention following:
Adding check for all requirements on each request will increase complexity of these requests without real need in most of the cases.
Also not all frontend requirements are necessary on each page and some of the pages may work even with some requirements missing - we don't want to block access to frontend in such cases.
Skipping frontend setup procedure when installing Zabbix frontend is advanced procedure and should be performed by specialists with understanding consequences of it.

Thank you for your report, we understand the problem, you described, but by reasons, mentioned above, we decided to keep this issue as Won't fix.

Generated at Wed Jun 25 07:33:07 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.