2012-08-24 09:53:02 +00:00
|
|
|
<!--
|
|
|
|
tagline: Solving problems
|
|
|
|
-->
|
2012-08-27 15:46:40 +00:00
|
|
|
# Troubleshooting
|
|
|
|
|
|
|
|
This is a list of common pitfalls on using Composer, and how to avoid them.
|
|
|
|
|
|
|
|
## General
|
|
|
|
|
|
|
|
1. When facing any kind of problems using Composer, be sure to **work with the
|
|
|
|
latest version**. See [self-update](03-cli.md#self-update) for details.
|
|
|
|
|
|
|
|
2. Ensure you're **installing vendors straight from your `composer.json`** via
|
2012-10-08 17:42:28 +00:00
|
|
|
`rm -rf vendor && composer update -v` when troubleshooting, excluding any
|
|
|
|
possible interferences with existing vendor installations or `composer.lock`
|
|
|
|
entries.
|
2012-08-27 15:46:40 +00:00
|
|
|
|
|
|
|
## Package not found
|
|
|
|
|
|
|
|
1. Double-check you **don't have typos** in your `composer.json` or repository
|
|
|
|
branches and tag names.
|
|
|
|
|
|
|
|
2. Be sure to **set the right
|
|
|
|
[minimum-stability](04-schema.md#minimum-stability)**. To get started or be
|
|
|
|
sure this is no issue, set `minimum-stability` to "dev".
|
|
|
|
|
|
|
|
3. Packages **not coming from [Packagist](http://packagist.org/)** should
|
|
|
|
always be **defined in the root package** (the package depending on all
|
|
|
|
vendors).
|
|
|
|
|
|
|
|
4. Use the **same vendor and package name** throughout all branches and tags of
|
|
|
|
your repository, especially when maintaining a third party fork and using
|
|
|
|
`replace`.
|
|
|
|
|
|
|
|
## Memory limit errors
|
2012-08-24 09:53:02 +00:00
|
|
|
|
|
|
|
If composer shows memory errors on some commands:
|
|
|
|
|
|
|
|
PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
|
|
|
|
|
|
|
|
The `memory_limit` ini value should be increased.
|
|
|
|
|
2012-08-24 14:32:36 +00:00
|
|
|
> **Note:** Composer internally increases the memory_limit to 512M.
|
2012-08-24 13:06:03 +00:00
|
|
|
> It is a good idea to create an issue for composer if you get memory errors.
|
|
|
|
|
2012-08-24 09:53:02 +00:00
|
|
|
Get current value:
|
|
|
|
|
|
|
|
php -r "echo ini_get('memory_limit').PHP_EOL;"
|
|
|
|
|
2012-08-27 15:46:40 +00:00
|
|
|
Increase limit with `php.ini` for a `CLI SAPI` (ex. `/etc/php5/cli/php.ini` for
|
|
|
|
Debian-like systems):
|
2012-08-24 09:53:02 +00:00
|
|
|
|
2012-08-24 10:35:16 +00:00
|
|
|
; Use -1 for unlimited or define explicit value like 512M
|
2012-08-24 09:53:02 +00:00
|
|
|
memory_limit = -1
|
|
|
|
|
2012-08-24 10:35:16 +00:00
|
|
|
Or with command line arguments:
|
2012-08-24 09:53:02 +00:00
|
|
|
|
|
|
|
php -d memory_limit=-1 composer.phar <...>
|
|
|
|
|