【问题标题】:Php memory exhaustion on call_user_func_array for mysqli select querymysqli 选择查询的 call_user_func_array 上的 PHP 内存耗尽
【发布时间】:2018-11-05 10:09:59
【问题描述】:

我的脚本在这行代码处停止(只是空白,没有错误消息,尽管这可能是我的主机设置 - 小橙色):

call_user_func_array(array($stmt, 'bind_result'), refValues($parameters));

以下是其中的值:

First Array - that is, array($stmt, 'bind_result')
Array
(
    [0] => mysqli_stmt Object
        (
            [affected_rows] => -1
            [insert_id] => 0
            [num_rows] => 0
            [param_count] => 1
            [field_count] => 4
            [errno] => 0
            [error] => 
            [error_list] => Array
                (
                )

            [sqlstate] => 00000
            [id] => 1
        )

    [1] => bind_result
)

Parameter for Ref Values
Array
(
    [0] => 
    [1] => 
    [2] => 
    [3] => 
)

奇怪的是,它在我的本地 MAMP 实例上运行良好(相同的数据库,基本相同的 PHP 版本 - MAMP 是 5.6.32,A Small Orange 是 5.6.35)。 MAMP的MYSQL是5.6.38,小橙子是5.5.51-38.2。

进入函数的值也是相同的。 MySQLi 凭据是有效的,因为页面的其余部分有一些 SELECT 查询可以正常工作。

这是我的主机的问题还是我遗漏了什么?我承认我对 MySQLi 还不熟练,因为我是在 MYSQL 上长大的,而且没有时间真正适应这种变化。


编辑:新显示的错误代码如下:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4294967296 bytes) in [REDACTED] on line 171

现在的问题是,为什么一个相对简单的 MYSQL 调用会使用这么多内存 - 它只是从一个很小的表(256Kib!)中选择一个小行。

【问题讨论】:

标签: php mysqli mamp


【解决方案1】:

错误来自在数据库中使用带有长文本列的 mysqli(在本例中为“模板”)。我只是将该列更改为 mediumtext,现在一切正常。

来源:

Allowed memory size of 134217728 bytes exhausted (tried to allocate 4294967296 bytes)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-01
    • 2014-09-08
    • 1970-01-01
    • 2021-09-10
    • 2013-07-06
    • 2014-06-28
    • 2011-04-20
    相关资源
    最近更新 更多