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
composer-php
11,169
questions
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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/...
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\...
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 ...
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 ...
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 ...
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 ...
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 ...
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?
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....
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: ...
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 ...
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 ...
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": {
"...
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 ...
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 ...
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 ...
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 ...
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\\": "....
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 ...
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 ...
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", "...
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": {
...
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 ...
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 ...
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.
...
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": "...
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 ...
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' ...
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 ...
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---...
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 ...
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.
...
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-...
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 ...
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 ...
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....
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 ...
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 \
...
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'...
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?
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. ...
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....
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 ...