justadev
justadev

Reputation: 1496

Why PHP memory_limit instruction in php ini is ignored?

I have set the memory_limit in my php.ini like this:

root@web:/var/www/html# grep -r memory_limit /usr/local/etc/php
/usr/local/etc/php/php.ini-production:memory_limit = 5G
/usr/local/etc/php/php.ini-development:memory_limit = 5G

(btw, I don't know why I have two php.ini files)

Anyway, I restart apache, and I see that these instructions are not used:

root@web:/var/www/html# service apache2 restart
 * Restarting Apache httpd web server apache2                                                                                                       

root@web:/var/www/html# php -i | grep memory
memory_limit => 128M => 128M

As far as I checked, the php ini files are the ones that are actually used:

root@web:/var/www/html# php -i | grep ini
Configuration File (php.ini) Path => /usr/local/etc/php
Scan this dir for additional .ini files => /usr/local/etc/php/conf.d

Any idea what is the issue?

Upvotes: 0

Views: 233

Answers (1)

user8034901
user8034901

Reputation:

There needs to be a php.ini in that folder for it to work. php.ini-production and php.ini-development are just "templates" with different settings. You need to rename/copy one of those:

cp php.ini-production php.ini

Upvotes: 1

Related Questions