即使重新启动php.ini mysqli.allow_persistent也不会关闭 [英] php.ini mysqli.allow_persistent won't turn off even after php restart

查看:65
本文介绍了即使重新启动php.ini mysqli.allow_persistent也不会关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了什么:

  1. 我编辑了php.ini以包含mysqli.allow_persistent = Off
  2. 重新启动php
  3. php_info->>显示mysqli.allow_persistent = On
  1. I edited php.ini to include mysqli.allow_persistent = Off
  2. restarted php
  3. php_info -->> shows mysqli.allow_persistent = On

我什至尝试:

  1. ini_set('mysqli.allow_persistent', "Off");
  2. 但是php_info->>仍显示mysqli.allow_persistent = On

为什么以及如何解决此问题?

Why and how to fix this?

推荐答案

mysqli.allow_persistent实际上期望一个整数值,根据文档,默认值为1.这可能有点令人困惑,因为mysql.allow_persistent(不带i)使用打开/关闭"切换,并且在某些旧版本的PHP中,mysqli也可以使用打开/关闭".

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.

要禁用它,请在您的php.ini中使用它:

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

mysqli.allow_persistent = 0

这篇关于即使重新启动php.ini mysqli.allow_persistent也不会关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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