What's limiting my PHP resources?

后端 未结 3 654
深忆病人
深忆病人 2021-01-26 01:24

I\'m having a problem getting more memory out of PHP.

This is the error message:

Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to a         


        
相关标签:
3条回答
  • 2021-01-26 01:55

    My first instinct is to guess that PHP is reading a different php.ini.

    In Debian (and most likely Ubuntu), each version of PHP (cli, cgi, and apache) has its own copy of php.ini.

    0 讨论(0)
  • 2021-01-26 02:00

    I just pored over the code I was running, and someone had hard-coded this into a config file:

    ini_set('memory_limit', '20M');
    

    Which was overriding everything else I was doing. Whew.

    0 讨论(0)
  • 2021-01-26 02:14

    You could try setting it in the .htaccess file, that is what i had to do to get a site working on one server.

    here are the settings i used:

    php_value  upload_max_filesize  50M
    php_value  post_max_size  60M
    php_value  memory_limit  128M
    
    0 讨论(0)
提交回复
热议问题