问题
What I did:
- I edited php.ini to include
mysqli.allow_persistent = Off
- restarted php
- php_info -->> shows
mysqli.allow_persistent = On
I even tried:
ini_set('mysqli.allow_persistent', "Off");
- 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