Mbstring is missing from phpinfo but included in php.ini

Similar to this question: gd2 not showing up in phpinfo shows up in php -i

I have the same problem with mbstring

. I have included it in minephp.ini

(which is the only one php.ini

on my entire system ), and yes, I checked and double checked that!), But when I open phpinfo

on my Apache, the mbstring is missing. If I do php -i

, all data is mbstring

displayed well.

Apache ( phpinfo.php

)

Configuration File (php.ini) Path       C:\Windows
Loaded Configuration File               F:\PHP\5.4\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed            (none)

      

Apache ( index.php

)

Fatal error: Call to undefined function mb_get_info() 
in F:\Apache\httpd-2.4\htdocs\index.php on line 2

      

PHP CLI:

F:\Apache\httpd-2.4\htdocs> php --ini
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         F:\PHP\5.4\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

F:\Apache\httpd-2.4\htdocs> php index.php
array(14) {
  ["internal_encoding"]=>
  string(10) "ISO-8859-1"
  ["http_output"]=>
  string(4) "pass"
  ["http_output_conv_mimetypes"]=>
  string(31) "^(text/|application/xhtml\+xml)"
  ["func_overload"]=>
  int(0)
  ["func_overload_list"]=>
  string(11) "no overload"
  ["mail_charset"]=>
  string(5) "UTF-8"
  ["mail_header_encoding"]=>
  string(6) "BASE64"
  ["mail_body_encoding"]=>
  string(6) "BASE64"
  ["illegal_chars"]=>
  int(0)
  ["encoding_translation"]=>
  string(3) "Off"
  ["language"]=>
  string(7) "neutral"
  ["detect_order"]=>
  array(2) {
    [0]=>
    string(5) "ASCII"
    [1]=>
    string(5) "UTF-8"
  }
  ["substitute_character"]=>
  int(63)
  ["strict_detection"]=>
  string(3) "Off"
}

      

What's going on here? Errors in apache

/ phpinfo()

?

+3


source to share


1 answer


The problem is that when PHP is loaded via apache, it extension_dir

seems to be read relative to the root of the dir of the apache server.

But starting from the command line, it is read relative to the PHP dir root .



So even though it was the same downloaded php.ini

because I was installing the dir extension like ext

instead F:\PHP\5.4\ext

, apache (or rather: PHP) looked for it in F:\Apache\2.4\ext

, which it didn't use, for obvious reasons.

Installing extension_dir

to an absolute folder solved the problem. Now apache and cmd are loading the same config including all extensions (which is exactly what I wanted).

+5


source







All Articles