0

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

1
  • Composer is not normally run via the web - its usually done from the command line, but the images you posted (of stuff you could have copied and pasted here as text) is from your browser. Typically the CLI PHP uses a different configuration file. You can run phpinfo() in a script from the command line, but just php -i will give you the details formatted for a text session. Commented Apr 2, 2024 at 11:00

2 Answers 2

1

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

0

I just had a similar issue with apache and php. My variable was set correctly in the correct php.ini file and I was restarting the apache service but the values for php were not changing until I restarted the whole server. Turns out I was running php-fpm which is its own service (not php running as an apache 'module') and its that service that needs restarting not the apache one. Something along the lines of systemctl restart php-fpm or in my case systemctl restart php8.3-fpm may help

2

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.