从的phpinfo一个mbstring失踪,但在php.ini中启用 [英] mbstring missing from phpinfo but enabled in php.ini

查看:249
本文介绍了从的phpinfo一个mbstring失踪,但在php.ini中启用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题类似:<一href=\"http://stackoverflow.com/questions/17150860/gd2-not-showing-in-phpinfo-is-showing-in-php-i\">gd2不是的phpinfo显示,正显示出在php -i

我有 MBSTRING 同样的问题。我启用了它在我的的php.ini (是的唯一的php.ini 在我整个系统 - 是的,我检查双重检查了的),但是当我打开的phpinfo 上!我的Apache,MBSTRING缺失。如果我做 PHP -i ,所有的 MBSTRING 数据是很好的显示出来。

I have the same problem with mbstring. I enabled it in my php.ini (which is the only php.ini on my whole system - and yes, I checked and double checked that!), but when I open up phpinfo on my Apache, mbstring is missing. If I do php -i, all of the mbstring data is showing up nicely.

阿帕奇( 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)

阿帕奇(的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:

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"
}

这是怎么回事?在 apache的错误 / 的phpinfo()

推荐答案

现在的问题是,当PHP是通过Apache加载,的extension_dir 显然是读相对于Apache服务器根目录

The problem is, that when PHP is loaded via apache, the extension_dir is apparently read relative to the apache server root dir.

不过,从从命令行启动,它的阅读相对于PHP根目录

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

因此​​,尽管它是在同一加载的php.ini ,因为我设置扩展目录为外部代替的 F:\\ PHP \\ 5.4 \\分机,阿帕奇(或者说:PHP)搜查它在 F:\\ Apache的\\ 2.4 \\分机,它没有找到明显的原因。

Thus, despite it being the same loaded php.ini, because I set the extension dir as ext instead of F:\PHP\5.4\ext, apache (or rather: PHP) searched for it in F:\Apache\2.4\ext, which it didn't find for obvious reasons.

设置的extension_dir 来一个绝对的文件夹解决了问题。现在,Apache和CMD都加载完全相同的配置,包括所有的扩展(这正是我想要的是如何吧)

Setting the extension_dir to an absolute folder solved the issue. Now apache and cmd both load the exact same configuration, including all extensions (which is exactly how I wanted it).

这篇关于从的phpinfo一个mbstring失踪,但在php.ini中启用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆