Php – Change in php.ini not reflecting PHP Memory_Limit Master Value

amazon ec2amazon-web-servicesapache-2.4composerPHP

I am trying to install a composer package for AWS S3 integration and came across the Composer Out of Memory issue.

Upon checking phpinfo() I could see the loaded php configuration file is /etc/php.ini and the Max Memory Limit allocated was 256M

But while checking the file memory_limit allocated was 128M. I tried to change it and then restarted the server. But whatever I do the Master value remains at 256M.

I am able to change the values locally using .htaccess but unfortunately it wont work with composer.

Loaded Configuration File

php.ini values

Best Answer

You can search for other instances of the PHP memory_limit setting using the find command.
For example:

find /etc -type f -exec grep -H 'memory_limit' {} \;

This will search all files (recursively) in /etc that mention memory_limit.

As a note: The composer site suggests values as high as 2gb.
https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors