Gone are the days of stitching together disparate services in an effort to
create a solid continue integration and deployment pipeline. GitLab has had it’s
Runners for a while and recently GitHub stepped into the mix with their Actions
offering.
Because of this, using external services like Travis CI or CircleCI is no longer
necessary and can effectively be dropped in favor of the stuff built right into
the version control services.
I love less moving parts, so any opportunity to subtract from the situation is a
huge win for me.
Moving to a new service isn’t without it’s faults though, as I found with
attempting to test a PHP project of mine on GitHub Actions.
Specifically on older versions of PHP, the very much past end-of-life 5.x
series, would run into issues running composer install
and run out of memory.
No big deal, I’ll just bump the INI setting to increase the memory limit.
Which I found did absolutely nothing.
I’m not in the trenches with PHP the way I used to be, so I wasn’t even aware
that composer
has it’s own memory limit setting outside of the PHP limit you
can configure in the INI.
To increase the memory limit for composer
, you need to set an environment
variable named COMPOSER_MEMORY_LIMIT
. It accepts similar values to
memory_limit
in php.ini
with -1
being “unlimited” memory (which obviously
is limited based on the server).
Setting the variable before calling composer
got me back in business:
COMPOSER_MEMORY_LIMIT=-1 composer install
As mentioned, this was only a problem on older PHP versions which I’m still a
bit reluctant to drop support for even though they are well past their “best by”
date. PHP 7.x+ has significantly better memory management, fortunately.