composer laravel install: "http://packagist.org" file could not be downloaded - php

I want to install laravel 2.2 through composer with
$ composer create-project --prefer-dist laravel/laravel sampleBackend 5.2
but every time i do that composer shows a message:
The
"http://packagist.org/p/provider-2014%2490c266c2df21924a932e564b7f39bf03d55b933fbe43744a6056eab59b7b4cf9.json"
file could not be downloaded: failed to open stream: HTTP request
failed! http://packagist.org could not be fully loaded, package
information was loaded from the local cache and may be out of date

Clear composer cache first by running
composer clear-cache
Then run this command
composer -vvv
This solution worked for me when I was trying to install laravel.

Related

failed to install laravel via composer, failed to install symfony

i just installed laravel for the first time and got this error, i have reinstalled Composer many times but it doesn't work, maybe you guys can help me out
PHP version 8.2
i installed laravel global installer, but it shows symfony things error, i have reinstalled composer but it doesn't work
please see this url ( installation laravel)
first: install composer on OS (Linux , Windows or MAC)
If you have already installed Composer, you must be clear chache in composer:
php composer.phar clear-cache
or this command:
composer clear-cache
then Using installation via composer:
composer create-project laravel/laravel example-app

Composer freezes while installing Laravel 5.6

I am installing Laravel 5.6 with the composer. This process is carried out in Windows 10's native command prompt. However when I type in composer create-project --prefer-dist laravel/laravel my_blog, composer doesn't do anything. It just stays still. Left it for 1.5 hours and the result is same.
Please help me fix it.
php composer create-project laravel/laravel my_blog --prefer-dist
File composer.phar must be in folder where you start command create-project OR add composer.phar to your PATH environment variable
For test (in terminal):
composer -V

Composer takes forever to download even with hirak/prestissimo?

Why does composer create-project take forever to download and create project?
I have tried:
Slim:
$ composer create-project slim/slim-skeleton slim-app
Laravel:
$ composer create-project laravel/laravel lavavel-app"5.0.*" --prefer-dist
It is just extremely slow:
Installing slim/slim-skeleton (3.1.2)
- Installing slim/slim-skeleton (3.1.2) Downloading: 100%
Created project in mr-simon-cohen-slim
Loading composer repositories with package information
Updating dependencies (including require-dev)
(it just stuck here...)
Any ideas?
I'm on Kubuntu 16.10.
EDIT:
After installing hirak/prestissimo, I get this error:
$ composer create-project slim/slim-skeleton slim-app
Cannot create cache directory /home/tealou/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/tealou/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/tealou/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/tealou/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
(it stuck here forever now)
During installing hirak/prestissimo, I get this error:
$ composer global require "hirak/prestissimo:^0.3"
Changed current directory to /home/teelou/.composer
[ErrorException]
file_put_contents(./composer.json): failed to open stream: Permission denied
So i used sudo:
$ sudo composer global require "hirak/prestissimo:^0.3"
[sudo] password for teelou:
Changed current directory to /home/teelou/.composer
Do not run Composer as root/super user! See https://getcomposer.org/root for details
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing hirak/prestissimo (0.3.5) Downloading: 100%
Writing lock file
Generating autoload files
What can I do to fix this mess now?
EDIT 2:
I got it fixed by:
$ sudo chmod -R 777 /home/teelou/.composer/
But hirak/prestissimo does not help in speeding up the download at all. It is still very slow.

laravel installing with composer in xampp in window 7

composer is installed successfully. but when I try to install laravel it shows this
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode
composer config --global repo.packagist composer https://packagist.org
then try again

Installing Symfony2 with composer failed on mac os

Trying to install Symfony2 via composer failer.
It'seems to be a access right issue :
cmd :
composer create-project symfony/framework-standard-edition /Users/anthonydiniro/WWW/win4u2.com
result:
Installing symfony/framework-standard-edition (v2.5.0)
- Installing symfony/framework-standard-edition (v2.5.0)
Downloading: 100%
[ErrorException]
copy(/Users/anthonydiniro/.composer/cache/files/symfony/framework-standard-edition/96cf36b581c9cd4827fe8c973080a6db085a49b6.zip): failed to open stream: P
ermission denied
Thanks for help
As always, the first good thing to try if you have encountered an error is to run
php composer.phar self-update
That will ensure the latest composer binaries. Then, run your installation again ;)
Try what jperovic said first!
otherwise try sudo composer create-project symfony/framework-standard-edition /Users/anthonydiniro/WWW/win4u2.com
If that doesn't work try sudo chmod 777 -R /Users/anthonydiniro/.composer/cache/

Categories