php.ini mysqli.allow_persistent won't turn off

2019-07-23 17:57发布

What I did:

  1. I edited php.ini to include mysqli.allow_persistent = Off
  2. restarted php
  3. php_info -->> shows mysqli.allow_persistent = On

I even tried:

  1. ini_set('mysqli.allow_persistent', "Off");
  2. but php_info -->> still shows mysqli.allow_persistent = On

Why and how to fix this?

1条回答
Deceive 欺骗
2楼-- · 2019-07-23 18:20

mysqli.allow_persistent actually expects an integer value, the default being 1 according to the documentation. This can be a bit confusing since mysql.allow_persistent (without the i) uses an On/Off toggle, and On/Off also works for mysqli in some older versions of PHP.

To disable it, use this in your php.ini:

mysqli.allow_persistent = 0

查看更多
登录 后发表回答