php.ini mysqli.allow_persistent won't turn off even after php restart

我与影子孤独终老i 提交于 2019-12-14 02:17:17

问题


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:


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



来源:https://stackoverflow.com/questions/51774572/php-ini-mysqli-allow-persistent-wont-turn-off-even-after-php-restart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!