\[InvalidArgumentException\] Could not find package vlucas/phpdotenv. Couldn't download package - php

I'm having a problem with vlucas/phpdotenv installation
 ~/ nslookup repo.packagist.org
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: repo.packagist.org
Address: 54.37.2.184
My composer.json:
{
"name": "developer/mvc",
"authors": [
{
"name": "Abubakr Abduvakhidov",
"email": "abubakr#edu.thedevs.co"
}
],
"autoload": {
"psr-4": {
"app\\": "."
}
},
"require": {}
}
Output of composer diagnose:
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.0.8
PHP version: 7.4.12
PHP binary path: /usr/local/Cellar/php/7.4.12/bin/php
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
cURL version: 7.73.0 libz 1.2.11 ssl OpenSSL/1.1.1h
zip: extension present, unzip present
When I run this command:
composer require vlucas/phpdotenv -vvv
I get the following output:
Loading config file /Users/abubakr/.composer/config.json
Loading config file /Users/abubakr/.composer/auth.json
Failed to initialize global composer: Composer could not find the config file: /Users/abubakr/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Running 2.0.8 (2020-12-03 17:20:38) with PHP 7.4.12 on Darwin / 20.1.0
Loading config file /Users/abubakr/.composer/config.json
Loading config file /Users/abubakr/.composer/auth.json
Failed to initialize global composer: Composer could not find the config file: /Users/abubakr/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading ./composer.json
Loading config file /Users/abubakr/.composer/config.json
Loading config file /Users/abubakr/.composer/auth.json
Loading config file ./composer.json
Checked CA file /usr/local/etc/openssl#1.1/cert.pem: valid
Executing command (/Users/abubakr): git branch -a --no-color --no-abbrev -v
Executing command (/Users/abubakr): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/Users/abubakr): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/Users/abubakr): hg branch
Executing command (/Users/abubakr): fossil branch list
Executing command (/Users/abubakr): fossil tag list
Executing command (/Users/abubakr): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /Users/abubakr/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Downloading https://packagist.phpcomposer.com/packages.json
[200] https://packagist.phpcomposer.com/packages.json
Writing /Users/abubakr/.composer/cache/repo/https---packagist.phpcomposer.com/packages.json into cache
Downloading https://packagist.phpcomposer.com/p2/vlucas/phpdotenv.json
[404] https://packagist.phpcomposer.com/p2/vlucas/phpdotenv.json
Downloading https://packagist.phpcomposer.com/p2/vlucas/phpdotenv~dev.json
[404] https://packagist.phpcomposer.com/p2/vlucas/phpdotenv~dev.json
Downloading https://packagist.org/search.json?q=vlucas/phpdotenv&type=
[200] https://packagist.org/search.json?q=vlucas/phpdotenv&type=
[RuntimeException]
No composer.json present in the current directory, this may be the cause of
the following exception.
Exception trace:
() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Command/RequireCommand.php:193
Composer\Command\RequireCommand->execute() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Console/Application.php:310
Composer\Console\Application->doRun() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Console/Application.php:122
Composer\Console\Application->run() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/bin/composer:63
require() at /usr/local/Cellar/composer/2.0.6/bin/composer:24
[InvalidArgumentException]
Could not find package vlucas/phpdotenv.
Did you mean one of these?
vlucas/phpdotenv
sobyte/dotenv-php
calgamo/module-php-dotenv
abacaphiliac/zend-phpdotenv
davek1312/config
Exception trace:
() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Command/InitCommand.php:796
Composer\Command\InitCommand->findBestVersionAndNameForPackage() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Command/InitCommand.php:430
Composer\Command\InitCommand->determineRequirements() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Command/RequireCommand.php:189
Composer\Command\RequireCommand->execute() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Console/Application.php:310
Composer\Console\Application->doRun() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/src/Composer/Console/Application.php:122
Composer\Console\Application->run() at phar:///usr/local/Cellar/composer/2.0.6/bin/composer/bin/composer:63
require() at /usr/local/Cellar/composer/2.0.6/bin/composer:24
require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...
And I expected this to happen:
package to be installed
Additional:
 /Applications/XAMPP/xamppfiles/htdocs/php/mvc/ [master+*] which composer
/usr/local/bin/composer
 /Applications/XAMPP/xamppfiles/htdocs/php/mvc/ [master+*] alias | grep composer
 /Applications/XAMPP/xamppfiles/htdocs/php/mvc/ [master+*] ls
composer.json core models vendor
composer.lock migrations public views
controllers migrations.php runtime

Actually, it was because of loading metadata from https://packagist.phpcomposer.com/packages.json, which is not the official Packagist, but an official mirror (and a broken one according to the list in https://github.com/Webysther/packagist-mirror#-packagist-public-metadata-mirrors-observatory-around-the-world)
That's probably the reason for the issue: the package is not found in the metadata in this repository, but the repository still exposes the official search endpoint instead of a mirrored one, which is used by composer when looking for alternative names.
After running the command in the bottom it started downloading
composer config -g repo.packagist composer https://packagist.org

Related

Composer failing with Signal 9

I'm puzzled about this Composer failure. Can anyone help? The only things I've seen about "signal 9" have to do with resource limitations, which I do not have. It looks like a require() is failing?
I have a new M1-based macbook air, running PHP 8.0.0 and have Composer (v2.0.8) installed, both using homebrew. I'm trying to create a new Cakephp project.
I have git installed and running.
When I run:
composer -vvv create-project --prefer-dist cakephp/app projectname
Composer fails with a Symfony runtime exception signal 9 - as below:
composer -vvv create-project --prefer-dist cakephp/app projectname
Reading ./composer.json (/Users/xxxxxxx/Dropbox/Development/git/sites/composer.json)
Loading config file ./composer.json (/Users/xxxxxxx/Dropbox/Development/git/sites/composer.json)
Checked CA file /opt/homebrew/etc/openssl#1.1/cert.pem: valid
Executing command (/Users/xxxxxx/Dropbox/Development/git/sites): git branch -a --no-color --no-abbrev -v
[Symfony\Component\Process\Exception\RuntimeException]
The process has been signaled with signal "9".
Exception trace:
() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/vendor/symfony/process/Process.php:366
Symfony\Component\Process\Process->wait() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/vendor/symfony/process/Process.php:198
Symfony\Component\Process\Process->run() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Util/ProcessExecutor.php:125
Composer\Util\ProcessExecutor->doExecute() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Util/ProcessExecutor.php:65
Composer\Util\ProcessExecutor->execute() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Package/Version/VersionGuesser.php:122
Composer\Package\Version\VersionGuesser->guessGitVersion() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Package/Version/VersionGuesser.php:71
Composer\Package\Version\VersionGuesser->guessVersion() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Package/Loader/RootPackageLoader.php:81
Composer\Package\Loader\RootPackageLoader->load() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Factory.php:368
Composer\Factory->createComposer() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Factory.php:595
Composer\Factory::create() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Console/Application.php:409
Composer\Console\Application->getComposer() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Console/Application.php:527
Composer\Console\Application->getPluginCommands() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Console/Application.php:187
Composer\Console\Application->doRun() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/src/Composer/Console/Application.php:122
Composer\Console\Application->run() at phar:///opt/homebrew/Cellar/composer/2.0.8/bin/composer/bin/composer:63
require() at /opt/homebrew/Cellar/composer/2.0.8/bin/composer:24
This is resolved. I used Homebrew to reinstall git. Once I did that, composer worked. What tipped me off was running "brew update" and getting:
Error: Failure while executing; git config --replace-all homebrew.analyticsmessage true was terminated by uncaught signal KILL.
I figured git was broken somehow (Odd, since I've been using it.) So I reinstalled it.

Symfony + Travis-CI + Heroku + GitHub basic .gitignore and travis.yml?

I created a Symfony project with the composer command: "composer create-project symfony/framework-standard-edition my_project_name" and I put it under version control using git and GitHub as remote hosting.
In addittion I need to use Travis-CI for continuous integration and status checking, together with Heroku for deployment.
Being the first time I use Symfony, travis and heroku I am having some trouble with their configuration files.
This is my .gitignore file:
/.idea
/app/config/parameters.yml
/build/
/phpunit.xml
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/logs
/var/logs/*
!var/logs/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
/vendor/
/web/bundles/
And this is my .travis.yml file:
language: php
php:
- '5.5'
- '5.6'
- '7.0'
- hhvm
- nightly
This is the log of travis-ci failing
What I understood is that there is a lack of dependencies under vendor directory, which has been ignored by git due to solve the error message of heroku bild:
-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
- php (7.1.0)
- apache (2.4.20)
- nginx (1.8.1)
-----> Installing dependencies...
Composer version 1.2.2 2016-11-03 17:43:15
! WARNING: Your Composer vendor dir is part of your Git repository.
This directory should not be under version control; only your
'composer.json' and 'composer.lock' files should be added, which
will let Composer handle installation of dependencies on deploy.
To suppress this notice, first remove the folder from your index
by running 'git rm -r --cached vendor/'.
Next, edit your project's '.gitignore' file and add the folder
'/vendor/' to the list.
For more info, refer to the Composer FAQ: https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
Loading composer repositories with package information
Installing dependencies from lock file
- Removing symfony/phpunit-bridge (v3.1.7)
- Removing sensio/generator-bundle (v3.1.1)
Generating optimized autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "SensioGeneratorBundle" from namespace "Sensio\Bundle\GeneratorBundle".
Did you forget a "use" statement for another namespace? in /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/app/AppKernel.php:25
Stack trace:
#0 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(396): AppKernel->registerBundles()
#1 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(114): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#3 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Component/Console/Appli in /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/app/AppKernel.php on line 25
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "SensioGeneratorBundle" from namespace "Sensio\Bundle\GeneratorBundle".
Did you forget a "use" statement for another namespace? in /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/app/AppKernel.php:25
Stack trace:
#0 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(396): AppKernel->registerBundles()
#1 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(114): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#3 /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/vendor/symfony/symfony/src/Symfony/Component/Console/Appli in /tmp/build_3481ed5a9ce634e19d2af5d00bd7a3f9/izio7-YourTeam-8f31587/app/AppKernel.php on line 25
.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
! Push rejected, failed to compile PHP app.
! Push failed
Is there some command or change I can do, in order to make it work both with travis-ci and heroku without versioning the vendor directory or in some other way? Thanks in advance.
I solved the problem by updating the .travis.yml with composer install.
language: php
php:
- '5.5'
- '5.6'
- '7.0'
- hhvm
- nightly
before_script: composer install

composer php cli has stopped working

I have tried to install with following command laravel / lumen:
composer global require "laravel/lumen-installer=~1.0"
But my commandline ends with an error: "CLI has stopped working" in my windows event-log is following entry:
Name der fehlerhaften Anwendung: php.exe, Version: 5.6.8.0, Zeitstempel: 0x5553b22c
Name des fehlerhaften Moduls: php5ts.dll, Version: 5.6.8.0, Zeitstempel: 0x5553b2a2
Ausnahmecode: 0xc0000005
Fehleroffset: 0x0004a5ec
ID des fehlerhaften Prozesses: 0x1168
Startzeit der fehlerhaften Anwendung: 0x01d1247012bc4f0e
Pfad der fehlerhaften Anwendung: D:\Applications\MAMP\bin\php\php5.6.8\php.exe
Pfad des fehlerhaften Moduls: D:\Applications\MAMP\bin\php\php5.6.8\php5ts.dll
Berichtskennung: e7132df8-3deb-4564-9ee1-9b7e15010821
Vollständiger Name des fehlerhaften Pakets:
Anwendungs-ID, die relativ zum fehlerhaften Paket ist: ...
I search for a solutions via google but nothing found - nothing worked for me
kind regards
If i am typing "composer global require "laravel/lumen-installer=~1.0" -vvv"
D:\workspace>composer global require "laravel/lumen-installer=~1.0" -vvv
Changed current directory to C:/Users/xxx/AppData/Roaming/Composer
Reading ./composer.json
Loading config file ./composer.json
Executing command (C:\Users\xxx\AppData\Roaming\Composer): git describe --exact-match --tags
Executing command (C:\Users\xxx\AppData\Roaming\Composer): git branch --no-color --no-abbrev -v
Executing command (C:\Users\xxx\AppData\Roaming\Composer): hg branch
Executing command (C:\Users\xxx\AppData\Roaming\Composer): svn info --xml
./composer.json has been updated
Reading ./composer.json
Loading config file ./composer.json
Executing command (C:\Users\xxx\AppData\Roaming\Composer): git describe --exact-match --tags
Executing command (C:\Users\xxx\AppData\Roaming\Composer): git branch --no-color --no-abbrev -v
Executing command (C:\Users\xxx\AppData\Roaming\Composer): hg branch
Executing command (C:\Users\xxx\AppData\Roaming\Composer): svn info --xml
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-2013.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-01.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-04.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-07.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-10.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-archived.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/p-provider-latest.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/provider-laravel$lumen-installer.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/provider-guzzlehttp$guzzle.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/provider-symfony$console.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/provider-symfony$process.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/provider-guzzlehttp$streams.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/provider-guzzlehttp$ringphp.json from cache
Reading C:/Users/xxx/AppData/Local/Composer/repo/https---packagist.org/provider-react$promise.json from cache
Analyzed 626 packages to resolve dependencies
Analyzed 7133 rules to resolve dependencies
- Installing symfony/process (v2.7.7)

zlib_decode(): data error using composer in the doctrine2 tutorial

UPDATE:
I posted this issue to the bug tracker a while ago as suggested in comments, and now I ran a clean installation of the new version of composer (Composer version 7131607ad1d251c790ce566119d647e008972aa5 2014-05-27 14:26:24) and the issue is fixed.
ORIGINAL POST:
I'm trying to learn how to use doctrine2 using their tutorial at http://docs.doctrine-project.org/en/latest/tutorials/getting-started.html
but for some reason I get this error when trying to run composer install:
[ErrorException]
zlib_decode(): data error
Here is the contents of composer.json:
{
"require": {
"doctrine/orm": "2.4.*",
"symfony/yaml": "2.*"
},
"autoload": {
"psr-0": {"": "src/"}
}
}
EDIT: PHP Version 5.5.9.
EDIT: output of composer install -vvv:
Reading ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing C:/Users/User/AppData/Local/Composer/repo/https---packagist.org/packages.json into cache
Installing dependencies (including require-dev)
Downloading https://packagist.org/p/provider-active$1874cad4a77f2dbd91c33e813330434e6c38cd940846c58a610595dac158d161.json
Writing C:/Users/User/AppData/Local/Composer/repo/https---packagist.org/p-provider-active.json into cache
Downloading https://packagist.org/p/provider-archived$02a49245f4912f279bea7cd3a287cb32b6ab02623037965e5f9665bf27fe3ec9.json
Downloading https://packagist.org/p/provider-archived$02a49245f4912f279bea7cd3a287cb32b6ab02623037965e5f9665bf27fe3ec9.json
Downloading https://packagist.org/p/provider-archived$02a49245f4912f279bea7cd3a287cb32b6ab02623037965e5f9665bf27fe3ec9.json
[ErrorException]
zlib_decode(): data error
Exception trace:
() at phar://C:/composer/composer/src/Composer/Util/RemoteFilesystem.php:217
Composer\Util\ErrorHandler::handle() at n/a:n/a
zlib_decode() at phar://C:/composer/composer/src/Composer/Util/RemoteFilesystem
.php:217
Composer\Util\RemoteFilesystem->get() at phar://C:/composer/composer/src/Compos
er/Util/RemoteFilesystem.php:82
Composer\Util\RemoteFilesystem->getContents() at phar://C:/composer/composer/sr
c/Composer/Repository/ComposerRepository.php:612
Composer\Repository\ComposerRepository->fetchFile() at phar://C:/composer/compo
ser/src/Composer/Repository/ComposerRepository.php:519
Composer\Repository\ComposerRepository->loadProviderListings() at phar://C:/com
poser/composer/src/Composer/Repository/ComposerRepository.php:271
Composer\Repository\ComposerRepository->whatProvides() at phar://C:/composer/co
mposer/src/Composer/DependencyResolver/Pool.php:254
Composer\DependencyResolver\Pool->computeWhatProvides() at phar://C:/composer/c
omposer/src/Composer/DependencyResolver/Pool.php:243
Composer\DependencyResolver\Pool->whatProvides() at phar://C:/composer/composer
/src/Composer/DependencyResolver/Solver.php:149
Composer\DependencyResolver\Solver->setupInstalledMap() at phar://C:/composer/c
omposer/src/Composer/DependencyResolver/Solver.php:163
Composer\DependencyResolver\Solver->solve() at phar://C:/composer/composer/src/
Composer/Installer.php:467
Composer\Installer->doInstall() at phar://C:/composer/composer/src/Composer/Ins
taller.php:215
Composer\Installer->run() at phar://C:/composer/composer/src/Composer/Command/I
nstallCommand.php:122
Composer\Command\InstallCommand->execute() at phar://C:/composer/composer/vendo
r/symfony/console/Symfony/Component/Console/Command/Command.php:241
Symfony\Component\Console\Command\Command->run() at phar://C:/composer/composer
/vendor/symfony/console/Symfony/Component/Console/Application.php:892
Symfony\Component\Console\Application->doRunCommand() at phar://C:/composer/com
poser/vendor/symfony/console/Symfony/Component/Console/Application.php:191
Symfony\Component\Console\Application->doRun() at phar://C:/composer/composer/s
rc/Composer/Console/Application.php:117
Composer\Console\Application->doRun() at phar://C:/composer/composer/vendor/sym
fony/console/Symfony/Component/Console/Application.php:121
Symfony\Component\Console\Application->run() at phar://C:/composer/composer/src
/Composer/Console/Application.php:83
Composer\Console\Application->run() at phar://C:/composer/composer/bin/composer
:43
require() at C:\composer\composer:15
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-p
lugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--ver
bose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
During the last day I've spend a lot of time trying to deal with zlib_decode(): data error problem and it definitely is not related to what exact package you are trying to install. It has to do something with proxy and/or bad internet connection. Disabling antivirus did not help my case as I'm not using antivirus on my Mac. These are the things that did help in the end.
1. Force HTTPS for package retrieval by adding this to your composer.json.
{
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{"packagist": false}
],
"require": { /* your packages as usual */ }
}
2. If you still experience the problem, try to run composer diag. In my case few of the messages there were:
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
After doing composer self-update --update-keys and following the instructions - on the next attempt, all worked fine.
In my case it was Avast antivirus. After disabling everything updated without problems.
Just install unzip on your machine, if you are using debian/ubuntu:
sudo apt-get install unzip
That works for me!

My composer won't update completely with Laravel 4 it gets stuck with artisan

Here is the error I am getting:
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
This shows after:
Writing lock file
Generating autoload files
I tried to delete all my folders in my vendor folder. But that did not change anything.
I am using MAMP server on my Mac OS X.
PHP Version 5.4.10
mcrypt 2.5.8
I just tried "sudo composer update --verbose" and I got this error:
sudo composer update --verbose
Password:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
Exception trace:
() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:148
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:107
Composer\EventDispatcher\EventDispatcher->dispatchCommandEvent() at phar:///usr/bin/composer/src/Composer/Installer.php:289
Composer\Installer->run() at phar:///usr/bin/composer/src/Composer/Command/UpdateCommand.php:118
Composer\Command\UpdateCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244
Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:897
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:191
Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:117
Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:121
Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:83
Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:43
require() at /usr/bin/composer:15
Here is the error I found in my PHP error logs:
[04-Nov-2013 20:45:44 Europe/Berlin] PHP Fatal error: Class 'Patchwork\Utf8\Bootup' not found in /Applications/MAMP/htdocs/-----/bootstrap/autoload.php on line 46
I just tried to test my composer:
sudo composer diagnose
Password:
Checking platform settings: OK
Checking http connectivity: OK
Checking composer.json: FAIL
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Name "andrew13/Laravel-4-Bootstrap-Starter-Site" does not match the best practice (e.g. lower-cased/with-dashes). We suggest using "andrew13/laravel-4-bootstrap-starter-site" instead. As such you will not be able to submit it to Packagist.
Checking disk free space: OK
Checking composer version: OK
Just applied the recommendation in the error message from the last command. Now everything is showing as OK.
I just tried this:
curl -sS https://getcomposer.org/installer | php -- --check
#!/usr/bin/env php
All settings correct for using Composer
I am now getting new errors in my PHP Error logs:
[05-Nov-2013 05:45:45 Europe/Berlin] PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class config does not exist' in /Applications/MAMP/htdocs/---/bootstrap/compiled.php:165
Stack trace:
#0 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(165): ReflectionClass->__construct('config')
#1 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(142): Illuminate\Container\Container->build('config', Array)
#2 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(444): Illuminate\Container\Container->make('config', Array)
#3 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(233): Illuminate\Foundation\Application->make('config')
#4 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(3151): Illuminate\Container\Container->offsetGet('config')
#5 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(103): Illuminate\Exception\ExceptionServiceProvider->Illuminate\Exception\{closure}(Object(Illuminate\Foundation\Application))
#6 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(163): Illuminate\Container\Container->Illum in /Applications/MAMP/htdocs/---/bootstrap/compiled.php on line 165
I believe this error results from not being able to find mcrypt.
Script php artisan optimize handling the post-update-cmd event returned with an error
Apparently it is not quite that easy to install mcrypt.
Install the php5-mcrypt package, or verify that it has been installed correctly.
sudo apt-get install php5-mcrypt
Check whether mcrypt has been installed and enabled for PHP:
php --ri mcrypt
You're done if it says:
mcrypt support => enabled
Otherwise, continue if it says:
Extension 'mcrypt' not present.
Verify that mcrypt.ini is present in PHP's mods-available directory.
ls /etc/php5/mods-available/mcrypt.ini
If it says No such file or directory, create a symbolic link from mcrypt.ini to PHP's mods-available directory.
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
Enable the mod.
sudo php5enmod mcrypt
Restart apache.
sudo service apache2 restart
Check again whether mcrypt is enabled.
php --ri mcrypt
The final steps were inspired by Vuk Stanković.
Okay, did some further research with Google and it seems that this has to do with the autoload caching from Composer. There are various ways on how you can solve this.
composer dump-autoload
This would re-create the autoload stuff for you and it should solve your problem for now.
If this doesn't help, try deleting everything and re-install fresh: [ref]
rm -rf /path/to/composer.lock /path/to/vendor/
composer install
This would re-create just about everything.
It looks like your laravel install did not run correctly and since part of the composer.json runs the php artisan clear-compiled and php artisan optimize if your laravel application is not working then composer will fail.
Try running your composer update without invoking the Laravel scripts.
php composer update --no-scripts
After that you can either run the commands from the scripts block in your composer.json manually. Else you can just run a standard
php composer update
again which will run the scripts for you.
To fix this you need to install mcrypt.
In ubuntu execute the following command:
sudo apt-get install php5-mcrypt
Then update composer:
composer update
Another solution for me, setting xdebug.scream = 1 gives problem:
1) Find xdebug configuration file.
$ sudo find / -name xdebug.ini
2) Edit file using any text editor.
$ sudo vi /your_path/xdebug.ini
3) Set xdebug.scream = 0
4) Reload server
$ sudo service apache2 reload
I had a similar issue when trying to run composer update and none of the solutions above had worked. It turns out I had 2 require sections in my composer.json which is actually wrong.
"require": {
"laravel/framework": "4.1.*"
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable",
"require": {
"barryvdh/laravel-ide-helper": "1.*",
"zizaco/confide": "3.2.x",
"laravelbook/ardent": "dev-master",
"zizaco/entrust": "dev-master"
},
"require-dev": {
"way/generators": "2.*",
"fzaninotto/faker": "1.3.*#dev"
}
Combining the two as below solved my issue.
"require": {
"laravel/framework": "4.1.*",
"barryvdh/laravel-ide-helper": "1.*",
"zizaco/confide": "3.2.x",
"laravelbook/ardent": "dev-master",
"zizaco/entrust": "dev-master"
},
If you still have a problem, try deleting the composer.lock and the vendor directory and run
mv ~/.composer/cache ~/.composer/cache.bak
To clear the composer cache and finally run
sudo composer install
This should solve the issue.

Categories