Upper memory limit for PHP/Apache

前端 未结 9 1059
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 16:23

I\'m getting the error when I run my PHP script....

Fatal error: Out of memory (allocated 1827405824) (tried to allocate 88800 bytes)

I\'ve

相关标签:
9条回答
  • 2020-12-01 16:48

    Try this

    set_time_limit(300);
    ini_set('memory_limit', '20000M');
    
    0 讨论(0)
  • 2020-12-01 16:54

    try ini_set('memory_limit', '-1');

    0 讨论(0)
  • 2020-12-01 16:56

    In Ubuntu 18.04
    Check version PHP: php -v
    In my case I have PHP 7.4
    Edit file: nano /etc/php/7.4/apache2/php.ini
    Search and change memory_limit = 2048M
    Edit file: nano /etc/php/7.4/cli/php.ini
    Search and change memory_limit = 2048M
    Finally: service apache2 restart

    0 讨论(0)
提交回复
热议问题