[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PHP memory limit upper bound



On 10/2/2014 12:57 PM, Grigor Kolev wrote:
>>> Hi all,
> 
>>> 
> 
>>> I need to set the PHP memory limit to more than 512 MB and found that I
> 
>>> can't. Is this caused by the Suhosin patch (my guess), and how to get
> 
>>> around it?
> 
>>> 
> 
>>> (I tried to set suhosin.memory_limit to 1024M: no change. Was told that
> 
>>> php5-suhosin might be more configurable, but it breaks some package
> 
>>> dependencies, and I can't afford this easily.)
> 
> 
>>Did you try edit /etc/php5/conf.d/suhosin.ini from:-
> 
>>;suhosin.memory_limit = 0
> 
>>to:-
> 
>>suhosin.memory_limit = 1G
> 
> 
>>(NOTE the suffix used above)
> 
> 
>>Don't forget to check php.ini and ensure a similar settings for max_post
> 
>>and memory_limit
> 
> 
> No file /etc/php5/conf.d/suhosin.ini exists on a standard Sid php5-common
> 
> install at the moment. And no path /etc/php5/conf.d/. There are
> 
> /etc/php5/apache2/conf.d/ and /etc/php5/cli/conf.d/, with no file
> 
> suhosin.ini in either. (I tried to manually create one with this
> 
> setting: no result. Same with modifying php.ini.)
> 
> 
> <?php
> 
> ini_set ( 'suhosin.memory_limit', '1G' );
> 
> ini_set ( 'memory_limit', '1G' );
> 
> 
> ini_get ( 'memory_limit' );  // returns '1G' - so far, so good
> 
> 
> file_put_contents ( $about_520M );
> 
> // PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted...
> 
> 
> Changing the system to pass data in portions would require a nearly
> 
> complete rewrite (~70,000 lines of code). Data size never gets over
> 
> 1G, so with a 2G memory_limit, which is realistic, the system will work
> 
> fine.
> 
> 
> Thanks again,
> 
> 
> Grigor
> 
> 
>>> 
> 
>>> Debian Sid, amd64, php5-common 5.6.0+dfsg-1+b1. If you need more info,
> 
>>> please don't hesitate to ask.
> 
>>> 
> 
>>> Thanks in advance,
> 
>>> 
> 
>>> Grigor
> 


Create a file called phpinfo.php containing only the following:

<?php phpinfo(); ?>

The load the page.  Look through all of the settings.  Anything unusual?

Jerry


Reply to: