0

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

I just moved my project to a new server. I set the server up myself (apt-get install apache2 php5 mysql-server was most of that task). My project has a config.php file with the line

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

at the top. That used to work fine, but now it returns false and my script terminates due to lack of memory.

I've verified that safe_mode is off and disable_functions is empty. What other configuration directives can affect ini_set? Why is ini_set still failing?


If it matters:

$ uname -a
Linux drevo 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64 GNU/Linux

$ sudo apache2ctl -v
Server version: Apache/2.2.16 (Debian)
Server built:   Sep 29 2011 20:59:05

$ sudo php5 -v
PHP 5.3.3-7+squeeze6 with Suhosin-Patch (cli) (built: Jan 31 2012 10:56:51)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Community
  • 1
  • 1
Hubro
  • 56,214
  • 69
  • 228
  • 381
  • If your script really needs to access 1GB of ram, I think your code has some serious design problems. – TravisO Feb 03 '12 at 17:42
  • It's [PHPExcel](http://phpexcel.codeplex.com/) opening large zip files. It probably doesn't need 1024M of ram but it certainly needs more than 128 – Hubro Feb 03 '12 at 17:50
  • simple test: `echo ini_get('memory_limit'); echo '
    '; ini_set('memory_limit', '1024M'); echo ini_get('memory_limit');` probably problem is in your script
    – cetver Feb 03 '12 at 17:41
  • As I said, I just moved my project from one environment to another. The problem is with the new environment, probably a setting – Hubro Feb 03 '12 at 17:51

0 Answers0