Skip to main content

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

Filter by
Sorted by
Tagged with
683 votes
18 answers
1.2m views

How can I remove a package from Laravel using PHP Composer?

What is the correct way to remove a package from Laravel using PHP Composer? So far I've tried: Remove declaration from file composer.json (in the "require" section) Remove any class ...
igaster's user avatar
  • 13.4k
678 votes
7 answers
779k views

How to install a specific version of package using Composer?

I am trying to install a specific version of a package using Composer. I tried composer install and composer require but they are installing the latest version of the package. What if I want an older ...
gdaras's user avatar
  • 9,909
643 votes
11 answers
207k views

Should composer.lock be committed to version control?

I'm a little confused with composer.lock used in an application with a repository. I saw many people saying that we should not .gitignore composer.lock from the repository. If I update my libraries ...
Pierre de LESPINAY's user avatar
472 votes
8 answers
637k views

How to update a single library with Composer?

I need to install only 1 package for my SF2 distribution (DoctrineFixtures). When I run php composer.phar update I get - Updating twig/twig (dev-master 39d94fa => v1.13.0) The package ...
Tool's user avatar
  • 12.4k
401 votes
30 answers
540k views

Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

I have recently installed Laravel 5 via Composer. I tried creating a new controller using Artisan and got the following error. Am I missing something? bootstrap/../vendor/autoload.php. Failed to open ...
Scott's user avatar
  • 5,084
386 votes
24 answers
600k views

Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted

I am trying to add HWIOAuthBundle to my project by running the below command. composer require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle HWIOAuthBundle github: https://github....
Brian Chen's user avatar
  • 4,061
385 votes
9 answers
313k views

How to get list of all installed packages along with version in composer?

I have been working on a project using Symfony 2.1 on my local machine. I have uploaded it to my server but when I try and install the vendor bundles using Composer, I'm getting a lot of dependency ...
Dan's user avatar
  • 6,423
334 votes
4 answers
595k views

PHP7 : install ext-dom issue

I'm running laravel 5.4 on Ubuntu 16.04 server with PHP7. trying to install cviebrock/eloquent-sluggable package throw some error: pish@let:/home/sherk/ftp/www$ sudo composer require cviebrock/...
alex's user avatar
  • 7,785
326 votes
15 answers
216k views

Laravel 5 - artisan seed [ReflectionException] Class SongsTableSeeder does not exist

When I run php artisan db:seed I am getting the following error: [ReflectionException] Class SongsTableSeeder does not exist What is going on? My DatabaseSeeder class: <?php use Illuminate\...
Sasha's user avatar
  • 8,627
292 votes
19 answers
1.3m views

require(vendor/autoload.php): failed to open stream

I know that this issue has been posted many times, but for me it seems to be a different problem. Indeed, this error Warning: require(vendor/autoload.php): failed to open stream: No such file or ...
adrTuIPKJ44's user avatar
  • 3,073
289 votes
19 answers
416k views

Composer install error - requires ext_curl when it's actually enabled

I'm trying to install Facebook PHP SDK with Composer. This is what I get $ composer install Loading composer repositories with package information Installing dependencies (including require-dev) Your ...
Michal Artazov's user avatar
275 votes
4 answers
257k views

How to remove unused dependencies from composer?

I installed a package with composer, and it installed many other packages as dependencies. Now I uninstalled the main package with composer remove packageauthor/packagename, but all the old ...
Lorenz Meyer's user avatar
  • 19.7k
269 votes
5 answers
80k views

What Are the Differences Between PSR-0 and PSR-4?

Recently I've read about namespaces and how they are beneficial. I'm currently creating a project in Laravel and trying to move from class map autoloading to namespacing. However, I can't seem to ...
Varun Nath's user avatar
  • 5,634
269 votes
3 answers
84k views

What's the difference between require and require-dev? [duplicate]

I would like to know the difference between require and require-dev. The composer website doesn't offer a good explanation the difference between these two. The part that I don't get is Lists packages ...
slier's user avatar
  • 6,650
264 votes
5 answers
175k views

What are the differences between composer update and composer install?

What are the differences between composer update and composer install?
Dawlatzai Ghousi's user avatar
262 votes
41 answers
541k views

Running Composer returns: "Could not open input file: composer.phar"

I am new to symfony2 and reading symblog. In third chapter while trying with data-fixtures I tried the command: php composer.phar update but I got the error: Could not open input file: composer....
user3291745's user avatar
  • 2,679
246 votes
26 answers
423k views

PHP error: "The zip extension and unzip command are both missing, skipping."

When I run a composer update I get this error message: Loading composer repositories with package information Updating dependencies (including require-dev) Failed to download psr/log from dist: ...
b85411's user avatar
  • 9,760
245 votes
5 answers
229k views

Composer: how can I install another dependency without updating old ones?

I have a project with a few dependencies and I'd like to install another one, but I'd like to keep the others the way they are. So I've edited the composer.json, but if I run composer install, I get ...
duality_'s user avatar
  • 18.4k
241 votes
19 answers
302k views

Laravel PHP command not found

I installed Laravel using Composer without problems, but when I try to run laravel in the terminal, I get the following error: -bash: laravel: command not found The docs say that I need to do the ...
chemitaxis's user avatar
  • 14.5k
219 votes
8 answers
95k views

How to require a fork with composer?

This is my composer.json, I want to use Nodge's fork of lessphp project on Github "repositories": [{ "type": "package", "package": { "...
Neilime's user avatar
  • 2,727
218 votes
5 answers
226k views

How to deploy correctly when using Composer's develop / production switch?

Composer has the option to load several dependencies only while being in development, so the tools will not be installed in production (on the live server). This is (in theory) very handy for scripts ...
Sliq's user avatar
  • 16.3k
203 votes
26 answers
372k views

Tell Composer to use Different PHP Version

I've been stuck at this for a few days. I'm using 1and1 hosting, and they have their PHP set up a bit weird. If I use just php composer.phar install, then I'm using PHP 4.4.6, which is horribly ...
Boom's user avatar
  • 2,705
195 votes
28 answers
264k views

PHP Composer update "cannot allocate memory" error (using Laravel 4)

I just can't solve this one. I'm on Linode 1G RAM basic plan. Trying to install a package via Composer and it's not letting me. My memory limit is set to "-1" on PHP.ini Is there anything else I can ...
ericbae's user avatar
  • 9,634
188 votes
20 answers
208k views

Composer killed while updating

I got a problem, I tried to install a new package to my Laravel 4 project. But when I run php composer.phar update I get this: Loading composer repositories with package information Updating ...
cherrycoding's user avatar
  • 1,885
185 votes
4 answers
167k views

Composer require local package

I've got a couple of libraries [Foo and Bar] that I'm developing in concert, but are still technically separate things. Previously I've just re-defined the autoloader to like "Foo\\": "....
Sammitch's user avatar
  • 31.8k
180 votes
3 answers
199k views

Skip composer PHP requirement

We are using PHPCI and composer. The server which runs PHPCI is on PHP 5.3. For a project we added the Facebook PHP SDK, using composer. It requires PHP 5.4. Composer gets triggered by PHPCI and get ...
Armin's user avatar
  • 15.8k
169 votes
7 answers
129k views

How do I install Composer PHP packages without Composer?

I'm trying to install the Coinbase PHP API but it requires Composer: https://github.com/coinbase/coinbase-php I'm looking for a universal PHP solution (perhaps a function) to let me install composer ...
Amy Neville's user avatar
  • 10.4k
166 votes
15 answers
683k views

How can I resolve "Your requirements could not be resolved to an installable set of packages" error? [closed]

When I run composer update I receive some wired output. Here is my composer.json look like. { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "...
code-8's user avatar
  • 57.5k
163 votes
8 answers
222k views

composer: How to find the exact version of a package?

Suppose I'm writing a library A, that depends on another library, monolog for instance. I want to install the latest version of monolog, so I just put this inside composer.json: { "require": { ...
HappyDeveloper's user avatar
161 votes
28 answers
242k views

Laravel showing "Failed to clear cache. Make sure you have the appropriate permissions"

Laravel was displaying to me "Access denied for user 'homestead'@'localhost' (using password: YES)". One solution for this was clearing the cache and the config cache stored, all this with these three ...
E.Akio's user avatar
  • 2,328
161 votes
2 answers
61k views

composer discard changes: what do the [y,n,v,d,s,?] do

Simple question that's been bugging me for months. Occasionally I'll dive into the vendors directory to fix a bug (especially for our internal libs). After migrating and deploying the fix back to the ...
Mark Fox's user avatar
  • 8,854
160 votes
6 answers
196k views

What is the difference between require and require-dev sections in composer.json?

I'm beginning using composer, I know so little about it and have a little experience with web application development. I just walk through Nettuts+ Tutorial, so I have basic question about composer. ...
Artisan's user avatar
  • 4,092
159 votes
3 answers
117k views

Composer require branch name

For example I want to require: { "repositories": [ { "type": "git", "url": "https://github.com/google/google-api-php-client.git" } ], "require": { "google/apiclient": "...
Wizard's user avatar
  • 11.2k
158 votes
22 answers
290k views

Composer update memory limit

I need to run composer update at my hosting so I log in with ssh and try to run the following command inside /www folder where I have Laravel and composer installation: composer update I get this ...
Andrew's user avatar
  • 2,178
156 votes
11 answers
299k views

How to force composer to reinstall a library?

I'm using the ZF2 skeleton app and it has a .gitignore that prevents external libraries from being commited to git. While debugging I like to go and change stuff here and there in the libraries' ...
Julian's user avatar
  • 9,038
155 votes
1 answer
500k views

Error "Root composer.json requires php ^7.3 but your php version (8.0.0) does not satisfy that requirement" [duplicate]

I have an unusual error while running the composer install command. It requires PHP 7.3 while I have PHP 8.0.0. This question is different from Override PHP base dependency in composer, because I have ...
NIKHIL NEDIYODATH's user avatar
153 votes
3 answers
173k views

Cannot create cache directory .. or directory is not writable. Proceeding without cache in Laravel

I created a new Laravel project. When I go to the terminal to install the dependecies composer displays the following warning: Cannot create cache directory /home/w3cert/.composer/cache/repo/https---...
Karthik's user avatar
  • 5,719
143 votes
9 answers
187k views

Use PHP composer to clone git repo

I'm trying to use composer to automatically clone a git repository from github that isn't in packagist but it's not working and I can't figure out what am I doing wrong. I think I have to include it ...
martin's user avatar
  • 96k
142 votes
14 answers
181k views

Can't install package via composer: PHP extension zip is missing

I'm trying to install laravel installer with the composer on my Ubuntu PC, but I get this error during the installation. `Your requirements could not be resolved to an installable set of packages. ...
Andreas Sauer's user avatar
139 votes
7 answers
264k views

How to downgrade or install a specific version of Composer?

I'm getting the following error in a project I'm setting up: You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-...
Bash's user avatar
  • 1,569
138 votes
16 answers
483k views

The openssl extension is required for SSL/TLS protection

composer create-project flarum/flarum . --stability=beta I try to run this command, but it gave me this error. [RuntimeException] The ...
Mike Yang's user avatar
  • 2,775
138 votes
13 answers
166k views

Composer Warning: openssl extension is missing. How to enable in WAMP

Trying to install Composer dependency management tool on Win7/64 + WampServer 2.2 via the Setup Installer and I am getting the following message: The openssl extension is missing, which will reduce ...
sleeper's user avatar
  • 3,466
134 votes
3 answers
90k views

How to correctly require a specific commit in Composer so that it would be available for dependent packages?

I have a library foo/foo-lib which requires a specific commit from GitHub: { "name": "foo/foo-lib", "repositories": [ { "type": "vcs", "url": "https://github....
Maciej Sz's user avatar
  • 11.8k
134 votes
4 answers
42k views

What does the tilde (~) mean in my composer.json file?

I have this line in my composer.json file: "require": { ... "friendsofsymfony/user-bundle": "~2.0@dev", ... }, What does the tilde ~ in ~2.0@dev exactly mean? Is that a placeholder and ...
dialogik's user avatar
  • 9,532
132 votes
10 answers
267k views

How to install PHP composer inside a docker container

I try to work out a way to create a dev environment using docker and laravel. I have the following dockerfile: FROM php:7.1.3-fpm RUN apt-get update && apt-get install -y libmcrypt-dev \ ...
Andre's user avatar
  • 4,513
127 votes
14 answers
217k views

You must enable the openssl extension to download files via https

I wanted to install Zend Framework 2. So I downloaded the skeleton application. As mentioned in the ZF2 manual, we have to issue the command php composer.phar install Inside the skeleton. But I'...
Uttam Dutta's user avatar
  • 5,290
127 votes
2 answers
113k views

How to remove globally a package from Composer?

I ran this command to install globally PHPUnit: composer global require 'phpunit/phpunit=3.7.*' Now I want to uninstall globally PHPUnit. Any ideas?
winkster's user avatar
  • 1,373
123 votes
12 answers
157k views

Why composer install timeouts after 300 seconds?

I have small project made in symfony2 when I try to build it on my server it's always fails when unzipping symfony. Build was OK and suddenly composer won't unzip symfony and I didn't change anything. ...
zajca's user avatar
  • 2,418
121 votes
12 answers
343k views

Composer: The requested PHP extension ext-intl * is missing from your system

I am trying to use composer.json file. but, when I am trying to run command 'composer install' in my path/project/, I am getting an error: I have already configured my wamp for 'extension=php_intl....
Nono's user avatar
  • 7,176
121 votes
7 answers
188k views

Installing specific laravel version with composer create-project

The fastest and simplest way of installing Laravel is via composer command. From the laravel docs (http://laravel.com/docs/quick), it shows that we can install it with this: composer create-project ...
user1995781's user avatar
  • 19.3k

1
2 3 4 5
224