Skip to content

Instantly share code, notes, and snippets.

Last active June 14, 2022 15:09
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Composer with different ini or with different PHP

Hacking Composer

When you wanna

  • use different version of PHP for Composer (or other CLI apps)
  • use different php.ini with Composer, because of for example slow XDebug (that you don't even need with production phar of Composer)


  • save as /usr/local/bin/composer
  • save composer.php.ini as /usr/local/etc/composer.php.ini, or create your own ini
  • chmod +x /usr/local/bin/composer
  • profit


  • You can easily change the used PHP runtime by changing the php binnary to an absolute path
memory_limit = -1
max_execution_time = 0
date.timezone = "Europe/Prague"
realpath_cache_size = "4096K"
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 256
opcache.max_accelerated_files = 65407
opcache.validate_timestamps = false # keep in mind to flush the cache, once you update composer
opcache.save_comments = true
opcache.load_comments = true
opcache.max_file_size = 0
php -n -c /usr/local/lib/composer.php.ini /usr/local/bin/composer.phar $@
Copy link

Doulla1 commented Jun 14, 2022

Thanks !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment