You are not logged in.
Pages: 1
Hello!
Recently, when running php script from command line I got "Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1058011 bytes)" this bothers me because I have set memory_limit for 1024M in my /etc/php/php.ini long time ago. I cannot see any separated configuration for php-cli . How can I increase this limit for php-cli?
Offline
https://wiki.archlinux.org/index.php/PH … not_parsed
-edit-
php --ini should tell you, I guess, and Arch seems to use /etc/php/php.ini.
Last edited by lucke (2015-05-05 16:48:19)
Offline
I created php-cli.ini yesterday. Output of "php --ini" is:
Configuration File (php.ini) Path: /etc/php
Loaded Configuration File: /etc/php/php-cli.ini
Scan for additional .ini files in: /etc/php/conf.d
Additional .ini files parsed: /etc/php/conf.d/xdebug.ini
But today I still encountered memory exhaustion error, like I would have 128M of memory only (I set everywhere 1024M). Any ideas how is this possible?
Offline
Does this command return the right amounts for the local / global values?
php -i | grep memory_limit
Alternatively, is there anything in your code that might be setting the memory limit? For example:
ini_set("memory_limit", "128M");
Offline
I tried "php -i | grep memory_limit" and it returned 1024M so the proper amount, even if I was getting exhaused error on 128 MB, which is weird. I bypassed the problem somewhat by putting ini_set("memory_limit", "1024M"); in my script - only then it started to act like it was really 1024M but reason why my memory was locked on 128M for CLI otherwise is still unknown .
Offline
That's interesting.
I would bet there is something that is changing it locally for that script. You can always place a "phpinfo();exit;" call into the heading of your script to see what the variables are.
Offline
Pages: 1