Can't run any "composer create-project" or "composer require" command - performance

I tried to clone some packages to my symfony projects, but it seems there are some issues with repository servers.
My command stays there for ever and does nothing:
$ php composer.phar require sonata-project/admin-bundle
Does anyone know how to work around it?
Thanks,

Related

Why Composer uninstall things right after the installation?

Composer keeps removing the files just after it installs them!
I used composer create-project otra/skeleton --remove-vcs otra-user -vvv to debug and it shows things like :
- Installing otra/otra (1.0.0-alpha.2.4.0): Extracting archive
Executing async command (CWD): unzip -qq -o '/var/www/html/perso/otra-user/vendor/composer/tmp-ad5334fdc8c968f8ad3d54814c2b67c1' -d '/var/www/html/perso/otra-user/vendor/composer/cc30fdc4'
Executing command (CWD): rm -rf '/var/www/html/perso/otra-user/vendor/otra/otra'
Executing command (CWD): rm -rf '/var/www/html/perso/otra-user/vendor/composer/cc30fdc4'
And as usual since a few months, it finished with the infinite loop that shows :
2 packages you are using are looking for funding.
Use the composer fund command to find out more!
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Composer works like a charm before, I do not know what they have changed so I have all those issues now.
I have updated my Composer version and I did a composer diagnose but it shows nothing wrong.
I am using Composer 2.0.12 and PHP 8.0.3.
Thanks to #yivi that pointed me to an another problem in composer.json where I indeed did a loop...
I solved my problem replacing #otra-update by #otra-init in post-install-cmd and post-update-cmd which was what I really wanted to do.
Thanks for your time #Nico Haase and #yivi :)

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5"

I'm trying to upload a plain laravel v5.8 project to a server. It gives me this error
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5".
I updated the Laravel version to v6 and it still throws the same thing.
Is there any possible solution I tried many but nothing happens. Thanks in advance.
I faced this problem using the new version of composer, didn't have seen this issue before, although this question is a bit old the solution can help someone else.
I did this working in a development machine, if you really need to change the PHP version running in your server this isn't for you.
This problem is related to a composer configuration when you run the command "composer install" if you need to work with the configuration you already have and don't want to make changes which could lead to other problems you should:
remove the packages you already have installed which includes this configuration from composer
sudo rm -r vendor
run the command again with this flag: --ignore-platform-reqs
composer install --ignore-platform-reqs
Now composer won't perform this check anymore and you are good to go!

Composer 'create-project' command not downloading laravel

Already installed composer to 'C:/xampp/htdocs/crud' with cmd. However trying to install laravel via the 'composer create-project --prefer-dist laravel/laravel blog' command does not download or install anything. The 'composer global require laravel/installer' command produces the same result.
PS: don't know if it wrecks anything but, I was having trouble running the composer command at first, kept saying there is no app to open '.phar' files. I found an answer here that asked me run .phar files with php.exe by default and thats what i did.
A picture to show what happens when I run the composer commands to install laravel...

composer create-project without output

I'm trying to install laravel via composer in a windows 8 machine.
I'm running the command "composer create-project laravel/laravel --prefer-dist" in an empty folder and I'm getting no output to that command even after waiting for several minutes (no output, neither an error)...
I've tried also changing laravel/laravel to some nonexistan package name like "laravel1234" waiting some kind of error or something but nothing changes. I've to cancel with Ctrl+C
Feel free to tell me if I can update my question with some other information, I think probably I'm doing something wrong. Should I put a composer.json file in the folder? I think that isn't necessary with this command.
Thank you very much.
The command was slightly wrong as #justrohu said, however I think the lack of output is probably due to network issues.
Try this to see where composer is getting stuck:
composer -vvv create-project laravel/laravel your-project-name --prefer-dist
Hi there the command you are running should be like
composer create-project laravel/laravel your-project-name --prefer-dist
it is mentioned in here http://laravel.com/docs/quick#installation
It is simply a bad/slow connection problem, I had this issue yesterday at home! I tried it again from work, it worked! However, joe niland's comment to run the create-project in verbose mode (-vvv) is super helpful because you will not think of it as stuck.. and you will see things moving even if slow! Good luck on your Laravel Journey!
P.S. the command that you've used in your question misses out the project name, however i'm not gonna comment on that because others have commented on that, plus in one of your replies, you've said that you had already tried that.

Composer returning question marks

My mac is installed with composer and it works fine. I then clone a laravel project. When I run composer update, some of the dependencies require some php stuff to be downloaded first, like php53-mcrypt. After installing the php stuff, i ran composer update again, it returns a bunch of question marks. A bit of googling returns me answers that require to set the
detect_unicode=Off
in the php.ini. Set it off but still the same. Reinstall composer with the following command
curl -s getcomposer.org/installer | php -d detect_unicode=Off
Still the same. Anyone can help?
Apparently, I had to make sure I added the detect_unicode = off in the correct php.ini file. Reinstall composer with homebrew again and it works.

Resources