How to increase PHP memory_limit in Debian Jessie?

6.5k views Asked by At

I need to temporarily increase memory_limit on my Debian Jessie server. And no, I cannot make my script use less memory, as it is not my script and I really need to run it. Setting memory_limit and suhosin.memory_limit in php.ini does not have any effect.

Is there any other solution apart from recompiling PHP?

3

There are 3 answers

0
ld57 On

Really strange, I just changed my memory limit on Jessie, restarted apache, and phpinfo now shows the correct number.

Maybe your limit is set in a .htaccess file or via an ini_set() function?

7
venca On

Is your script running in CLI or HTTP? Are you sure if you changed settings in php.ini correctly?

0
pamekar On

Run php --ini on terminal to get the php.ini file for php-cli.

Also check phpinfo() for the php.ini file. You should edit these two files and restart apache service apache2 restart.