Skip to content

Instantly share code, notes, and snippets.

@cu12
Last active September 22, 2016 09:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cu12/99533890ddee1395bfdde24538a8781d to your computer and use it in GitHub Desktop.
Save cu12/99533890ddee1395bfdde24538a8781d to your computer and use it in GitHub Desktop.
Overriding PHP memory_limit in Travis

I was wondering why Travis is still using the default 1G memory limit while I was trying to override it.

The problem is that PHP loads custom ini files in alphabetical order, so travis.ini was loading after my memory.ini, overriding whatever I had there regarding memory_limit.

So the solution would be to prepend your custom ini files with a letter after t.

.travis.yml

before_install:
    - phpenv config-add ci/x_apcu.ini
    - phpenv config-add ci/x_memory.ini
    - phpenv config-add ci/x_redis.ini

For the reference:

ci/x_memory.ini

memory_limit="2G"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment