Questions tagged [composer-php]

Composer is an application-level package manager for the PHP programming language. It provides a standard format for managing with ease PHP-based project dependencies (libraries) and was strongly inspired by Node.js's "npm" and Ruby's "bundler". Use with the [php] tag

Presentation

Composer is an application-level package manager.

Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them inside your project's directory.

By default, it will never install anything globally.

Thus, it is considered a PHP-based project package manager.

Useful links

It aggregates all sorts of PHP packages that are installable with Composer.

Also, you can check your build log; it could be helpful for debugging.

  • Packanalyst: Packanalyst is a service that lets you browse packages from Packagist and shows who is using and implementing your interfaces / abstract classes/traits.
11065 questions
88
votes
10 answers

How to run composer from anywhere?

I have just installed composer in my /usr/bin folder, so when from that folder I run php composer.phar I get the help info about composer. But, when I try to run the same from other folder I get Could not open input file: composer.phar. How to call…
tirenweb
  • 30,963
  • 73
  • 183
  • 303
87
votes
20 answers

Laravel "valet install" not found

I am trying to set up Laravels Valet (Valet is a Laravel development environment for Mac). Everything works until it comes to the command "valet install". This command must be executed in terminal. But I got the error "command not found". Any ideas,…
Brotzka
  • 2,959
  • 4
  • 35
  • 56
82
votes
15 answers

Fatal error: Class 'Illuminate\Foundation\Application' not found

I am getting following error when I open my site which is made using laravel 5 Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\cms\bootstrap\app.php on line 14 I have tried removing vendor folder and composer.lock file and…
xenish
  • 1,384
  • 3
  • 14
  • 17
80
votes
7 answers

Composer throws [ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

I installed the latest version (1.0.0. stable) of composer and in my Yii2 project I typed this: php composer.phar update It gives me this error: [ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not…
Marko Mikulić
  • 1,047
  • 2
  • 10
  • 15
80
votes
6 answers

Force composer to require PHP Version between Version X and Version Y

I have a mix of different PHP versions running on my servers (max 5.3.5) and development machines (max 5.5.9). Now I ran into the problem that I did a "composer update" to get the latest Version of some external Bundles. My composer.json looks…
Fabian
  • 875
  • 1
  • 6
  • 9
78
votes
6 answers

Remove composer

I installed composer while trying to install CakePHP, but the installation was not successful and I want to uninstall composer. I am not finding any way to do this. For the installation I used the command: curl -s https://getcomposer.org/installer |…
Lazarus Rising
  • 2,597
  • 7
  • 33
  • 58
78
votes
2 answers

How does the "replace" property work with composer?

So how does the "replace" property work with composer? I have read the composer document but still not understand it. Searching for more info hasn't answered my questions. When I look at the composer.json file on Laravel/Framework on github. I can't…
Ilyes512
  • 2,627
  • 5
  • 23
  • 27
77
votes
5 answers

Composer: remove a package, clean up dependencies, don't update other packages

The situation Let's say I have a project with two packages installed by Composer: php composer.phar require 'squizlabs/php_codesniffer:~2.0' 'phpmd/phpmd:~2.1' The autogenerated composer.json file looks like this: { "require": { …
TachyonVortex
  • 8,242
  • 3
  • 48
  • 63
77
votes
3 answers

Composer: required packages with differing levels of minimum-stability

I have a composer file for a laravel installation with the following composer.json file: { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { …
Chris Schmitz
  • 20,160
  • 30
  • 81
  • 137
76
votes
28 answers

Composer Update failed -- out of memory

I got this error when running composer.phar update on my VM: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 144115188075867549 bytes) in phar:///bin/composer.phar/src/Composer/Util/RemoteFilesystem.php on…
Aldibe
  • 1,277
  • 2
  • 11
  • 16
76
votes
10 answers

Slow updating of composer dependencies, despite --prefer-dist flag

Why does it take up to two minutes for my composer dependencies to update, even when there have been no changes? A popular suggestion is to append the --prefer-dist flag: php composer.phar update --prefer-dist But this makes no difference in my…
Jonathan
  • 13,947
  • 17
  • 94
  • 123
75
votes
9 answers

Laravel 5 Class 'form' not found

I have added "illuminate/html": "5.*" to composer.json and ran "composer update". - Installing illuminate/html (v5.0.0) Loading from cache I ran this command in the root of the website. I modified the composer.json file in /root/.composer...…
Dan Hastings
  • 3,241
  • 7
  • 34
  • 71
74
votes
15 answers

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

When I run composer install on command promp, there exist error like this : Problem 1 - Installation request for laravel/horizon v1.1.0 -> satisfiable by laravel/horizon[v1.1.0]. - laravel/horizon v1.1.0 requires ext-pcntl * -> the…
moses toh
  • 12,344
  • 71
  • 243
  • 443
74
votes
3 answers

Can composer generate the `composer.lock` without actually download the packages?

It does exist a command to generate the composer.lock from a composer.json? Something similar ruby's bundler : $ bundle lock
ciaoben
  • 3,138
  • 4
  • 27
  • 42
72
votes
14 answers

Composer [UnexpectedValueException] error will trying to use composer to install a github project

I am trying to install a Github project using composer and get the following error: Composer [UnexpectedValueException] Your Github oauth token for github.com contains invalid characters: "" Can anyone explain what I need to do to correct this…
Lloyd
  • 731
  • 1
  • 5
  • 4