tchwork / utf8

Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP
Apache License 2.0
627 stars 50 forks source link

Php crash in Bootup on mb_regex_encoding('UTF-8'); #16

Closed atrakeur closed 10 years ago

atrakeur commented 10 years ago

Just after an update on the server, all my laravel applications suddently stopped working. I tracked down the issue in class/Patchwork/Utf8/Bootup.php It look like calling mb_regex_encoding('UTF-8'); ( around line 51) cause the script to stop running without outputing anything to the browser (no error output). I fixed the issue for now by calling this function only if function_exists("mb_regex_encoding") returns true. My app seems to be working well right now but I was wondering if it can break other things later.

My configuration: Linux 2.6.32-431.5.1.el6.x86_64 Apache/2.2.14 PHP 5.4.25 (CGI/FastCGI) Mcrypt 2.5.8 enabled

Any clue on how to fix this?

nicolas-grekas commented 10 years ago

how is that even possible? this code did not change since a long time, and the function call for mb_regex_encoding is inside a check that verifies that mbstring is loaded! what is exactly the patch you applied? Can't you find an explanation for that behavior? I need a clue...

GrahamCampbell commented 10 years ago

@atrakeur's description of no output is probably a segfault. Maybe xdebug could be of some help?

nicolas-grekas commented 10 years ago

What do you get on this server if you:

echo ini_get('disable_functions');

?

atrakeur commented 10 years ago

@GrahamCampbell : shared hosting so I can't provide much information on what happened, and can't run xdebug to sort it out. Also can't reproduce this issue on any of our dev machines.

@nicolas-grekas : your code display: system, show_source, exec, shell_exec, proc_open, passthru, set_time_limit, ini_restore, mysql_list_dbs, ini_alter, dl, pfsockopen, openlog, syslog, symlink, link, chgrp, leak, popen, escapeshellcmd, apache_child_terminate, apache_get_modules, apache_get_version, apache_getenv, apache_note, apache_setenv, virtual, mb_send_mail

Anyway, don't treat this bug as top priority, this hosting provider seems to be very unreliable and I can't find much information on the server configuration. Maybe we should close this issue for now and keep it for futher reference if this problem come up again later.