gpt4 book ai didi

PHP 通知 : A non well formed numeric value encountered in/var/www/zephyr/library/XenForo/Application. php on line 1534

转载 作者:搜寻专家 更新时间:2023-10-31 21:21:56 24 4
gpt4 key购买 nike

[Sat Aug 12 02:21:28.993810 2017] [php7:notice] [pid 20352] [client :14302] PHP 通知:/var/www/zephyr/library/XenForo/中遇到格式不正确的数值1534行的Application.php

    /**
* Gets the current memory limit.
*
* @return int
*/
public static function getMemoryLimit()
{
if (self::$_memoryLimit === null)
{
$curLimit = @ini_get('memory_limit');
if ($curLimit === false)
{
// reading failed, so we have to treat it as unlimited - unlikely to be able to change anyway
$curLimit = -1;
}
else
{
switch (substr($curLimit, -1))
{
case 'g':
case 'G':
$curLimit *= 1024; //This is line 1534
// fall through

case 'm':
case 'M':
$curLimit *= 1024;
// fall through

case 'k':
case 'K':
$curLimit *= 1024;
}
}

self::$_memoryLimit = intval($curLimit);
}

return self::$_memoryLimit;
}

不太确定如何解决这个问题,有点难过,我指出了第 1534 行

最佳答案

您在 $curLimit *= 1024; 中将一个字符串与一个整数相乘。因为 $curLimit 等于(例如)512M。所以你要做的是删除最后一个字符:

$curLimitNumber = substr($curLimit, 0, -1);//Will extract the number (512 FROM 512M)
switch (substr($curLimit, -1))
{
case 'g':
case 'G':
$curLimitNumber *= 1024;

关于PHP 通知 : A non well formed numeric value encountered in/var/www/zephyr/library/XenForo/Application. php on line 1534,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45648680/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com