2014-03-12 22:25
采纳率: 0%
浏览 159

在.user.ini中忽略了PHP mbstring.func_overload

I have mbstring.func_overload = 7 in my php.ini, and I need to have it set to 0 for one directory. I have found out I cannot use .htaccess when using PHP via mod_fcgid as I do in my Debian installation.

I have created a .user.ini in the directory where I want this setting set to 0 and I also placed a test.php containing a phpinfo(); line inside the same directory, to see if this .user.ini takes effect.

Beside of the setting above that I WANT to change I also put some other PHP settings in this .user.ini files which I will not keep there, they are just to notice if something actually changes.

My .user.ini:

post_max_size = 12M
upload_max_filesize = 128M

date.timezone = "UTC"

mbstring.language = German
mbstring.func_overload = 0

The strange thing is: all the above settings are accepted and shown as they are in my .user.ini when requesting the test.php file, as "local" settings, except one: mbstring.func_overload is still 7 both for local and global configuration.

enter image description here

Any hints why mbstring.func_overload is ignored while other PHP settings in my .user.ini work perfectly?

图片转代码服务由CSDN问答提供 功能建议

我的php.ini中有mbstring.func_overload = 7,我需要将它设置为0 目录。 我发现通过mod_fcgid使用PHP时我不能使用.htaccess,就像我在Debian安装中一样。

我在我想要这个设置集的目录中创建了一个.user.ini 到0,我还放置了一个包含phpinfo()的test.php; 在同一目录下的行,看看这个.user.ini是否生效。

除了我想要改变的上面的设置之外,我还在这个.user中放了一些其他的PHP设置。 ini文件,我不会留在那里,只是要注意事情是否真的发生了变化。


   post_max_size = 12M 
upload_max_filesize = 128M 
date.timezone =“UTC”
mbstring.language = German 
mbstring.func_overload = 0 

奇怪的是:在请求test.php文件时,所有上述设置都被接受并显示在我的.user.ini中,作为“本地”设置,除了一个:mbstring.func_overload 对于本地和全局配置仍然是7。


  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • du5591 2014-03-13 12:30

    I have same problem. I can change any mbstrings-settings in .user.ini, but not mbstring.func_overload.

    UPD: I found a reason - mbstring.func_overload can't be redefined in .user.ini, because have status PHP_INI_SYSTEM.

    This setting can only be changed from the php.ini file.

    Solution. Add follow lines into nginx.conf:


    location ~ \.php$ {
            fastcgi_param PHP_VALUE "date.timezone='Europe/Berlin'
            ...another fastcgi-options...


    解决 无用
    打赏 举报