ini_set(“memory_limit”) in PHP 5.3.3 is not working at all

前端 未结 6 1175
长发绾君心
长发绾君心 2020-11-28 10:57

I had this working before :

echo ini_get(\"memory_limit\").\"\\n\";
ini_set(\"memory_limit\",\"256M\");
echo ini_get(\"memory_limit\").\"\\n\";
6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 11:34

    Here's a list of things that are worth checking:

    Is Suhosin installed?

    • How to check whether Suhosin is installed?

    ini_set

    • The format is important ini_set('memory_limit', '512'); // DIDN'T WORK ini_set('memory_limit', '512MB'); // DIDN'T WORK ini_set('memory_limit', '512M'); // OK - 512MB ini_set('memory_limit', 512000000); // OK - 512MB

    When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used.

    http://php.net/manual/en/ini.core.php#ini.memory-limit

    • Has php_admin_value been used in .htaccess or virtualhost files?

    Sets the value of the specified directive. This can not be used in .htaccess files. Any directive type set with php_admin_value can not be overridden by .htaccess or ini_set(). To clear a previously set value use none as the value.

    http://php.net/manual/en/configuration.changes.php

提交回复
热议问题