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
4
votes
1 answer

PHP install package globally: apt-get vs composer

I found there are two options to install PHP package globally in Linux (Ubuntu 16.04): Using composer: composer global require symfony/finder The package will be located at ~/.config/composer/vendor/ Using apt-get: apt-get install…
Alexey Chuhrov
  • 1,787
  • 12
  • 25
4
votes
1 answer

What could cause a Composer package to autoload correctly on a PHP 7 environment but not PHP 5?

I developed a small library for internal use within my company and some of our clients. This library was developed on a PHP 7 environment. It has been installed and used successfully on my colleagues' computers and some of my clients severs running…
chesnutcase
  • 500
  • 2
  • 7
  • 20
4
votes
1 answer

Composer autoload file variables are not accessible in other files

I am new to the composer and here is my composer.json file: { "name": "asd", "authors": [ { "name": "test", "email": "test@me.com" } ], "require": { "vlucas/phpdotenv": "^2.4" }, …
Syed Aqeel
  • 1,009
  • 2
  • 13
  • 36
4
votes
1 answer

Travis CI building PHP project and pulling dependencies from Composer, tries to use git@ instead of https

Background We have a PHP project that was working fine with Travis CI until a certain point and since then has totally stopped working. The project is simply failing to build with Composer. Details The last successful build was: this one The most…
edmondscommerce
  • 2,001
  • 12
  • 21
4
votes
5 answers

composer failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

I'm new in lumen and i have done composer clear-cache then after composer update to install some package after configurating composer.json however i have got this error: [Composer\Downloader\TransportException] …
DINA TAKLIT
  • 7,074
  • 10
  • 69
  • 74
4
votes
1 answer

How to require a specific commit of a Drupal project?

I know this had been asked several times, but the other solutions don't work for me so the problem may be somewhere else. In a dependent project I require a package like this: "require": { "drupal/security_review": "dev-8.x-1.x#35ebae44" } but…
Onkeltem
  • 1,889
  • 1
  • 18
  • 27
4
votes
1 answer

How to get the file path where a class would be loaded from while using a composer autoload?

A PHP 7.1 application uses composer's autoloader to find class definitions. The namespace mappings are defined in a composer.json file. The application also uses ICU module's ResourceBundle classes to load localisable texts from *.res files. Each…
alik
  • 2,244
  • 3
  • 31
  • 44
4
votes
5 answers

Error: You made a reference to a non-existent script @php artisan package:discover

I am getting error at running composer dump-autoload at laravel project composer dump-autoload Generating autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump You made a reference to a non-existent script @php artisan…
Syed Waqas Bukhary
  • 5,130
  • 5
  • 47
  • 59
4
votes
3 answers

How to use composer with php 7.2 with docker compose

I'm trying to create a simple dev env for a web symfony app with docker compose. My problem is when trying to execute composer install I get this error: - doctrine/collections v1.5.0 requires php ^7.1 -> your PHP version (7.0.7) does not satisfy…
petekaner
  • 8,071
  • 5
  • 29
  • 52
4
votes
2 answers

Symfony cannot install new bundles because of composer permission issue

While try to install new bundles into my project composer issue happens which is regarding permission, issue follows Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile handling the symfony-scripts event…
abhinand
  • 554
  • 5
  • 10
4
votes
6 answers

Composer does not detect php7 instead it uses 5.6. How can I set the CLI to use php7

Here when I execute php -v , it says it has php7 but when I try to execute composer update the response it Your requirements could not be resolved to an installable set of packages. Problem 1 - This package requires php >=7.0.0 but your…
lonestar
  • 377
  • 1
  • 7
  • 16
4
votes
5 answers

Composer fails to install laravel/socialite 2.0

composer require laravel/socialite ^2.0 is failing with below error: Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for laravel/socialite 2.0 -> satisfiable by…
4
votes
2 answers

Suppress error messages / inspections for for specific folders or files

I'm using Composer and I don't want PhpStorm to run any error checking or inspections on the vendor folder as it is showing a false positive for some code in the vendor/composer/autoload_static.php file and hence is highlighting the lines in the…
Brett
  • 19,449
  • 54
  • 157
  • 290
4
votes
2 answers

Class 'Illuminate\Foundation\Application' not found Laravel

I installed via composer the Guzzle and i received this error, > @php artisan package:discover PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in…
BLDD
  • 483
  • 2
  • 8
  • 14
4
votes
3 answers

Changing vendor directory can't find files anymore using Symfony 3.4

I'm trying to change the directory of my dependencies on a Symfony 3.4 application. I need that because I'm working on macOS with Docker and I'd rather have them not shared with the host since the file synchronization is too slow. The related…
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307