Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

curtsheller's avatar

composer stopped working - can't figure out

Can't get composer to update, self-update, install, etc...

Tried reinstall global and local dir.

Using MAMP, OSX 10,10,4, php 5.6.7.


composer -vvv diagnose
Reading ./composer.json
Loading config file /Users/curt/.composer/config.json
Loading config file /Users/curt/.composer/auth.json
Loading config file ./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
Reading /Users/curt/.composer/composer.json
Loading config file /Users/curt/.composer/config.json
Loading config file /Users/curt/.composer/auth.json
Loading config file /Users/curt/.composer/composer.json
Loading config file /Users/curt/.composer/auth.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
Checking composer.json: Reading ./composer.json
OK
Checking platform settings: OK
Checking git settings: Executing command (CWD): git config color.ui
OK
Checking http connectivity to packagist: Downloading http://packagist.org/packages.json
FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json" file could not be downloaded: failed to open stream: Operation timed out
Checking https connectivity to packagist: Downloading https://packagist.org/packages.json
FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Operation timed out
Checking github.com oauth access: Downloading https://api.github.com/user/repos
OK
Checking disk free space: OK
Checking composer version: Downloading https://getcomposer.org/version


  [Composer\Downloader\TransportException]
  The "https://getcomposer.org/version" file could not be downloaded: failed to open stream: Operation timed out


Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:267
 Composer\Util\RemoteFilesystem->get() at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:83
 Composer\Util\RemoteFilesystem->getContents() at phar:///usr/local/bin/composer/src/Composer/Command/DiagnoseCommand.php:311
 Composer\Command\DiagnoseCommand->checkVersion() at phar:///usr/local/bin/composer/src/Composer/Command/DiagnoseCommand.php:135
 Composer\Command\DiagnoseCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:146
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:82
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:43
 require() at /usr/local/bin/composer:25


diagnose

Using Laravel 5.1

Mac OS X 10.10.4

Running MAMP 3.2.1

php -v PHP 5.6.7 (cli) (built: Apr 9 2015 19:32:03)

Can't figure it out.

Reinstalled composer. composer self update is not working.

only seems to happening with global composer local in working dir seems to work albeit slow.

Read this somewhere and tried to with this result.

curl -k https://packagist.org/packages.json
{"packages":[],"notify":"\/downloads\/%package%","notify-batch":"\/downloads\/","providers-url":"\/p\/%package%$%hash%.json","search":"\/search.json?q=%query%","provider-includes":{"p\/provider-2013$%hash%.json":{"sha256":"8e290f3d47387c614761a9dc40a2ef6fb7dafb0cfe2264296e8fab2c6ee36bff"},"p\/provider-2014$%hash%.json":{"sha256":"c0d0e03ec56584b3bf3148ac1565d89e789a57b90d72f83a7a54a55fbfc4f083"},"p\/provider-2014-07$%hash%.json":{"sha256":"9b2d66a77e2f17ca1c18602419a2b5Cur

That is all it returned and no error.

Any suggestions of where to look for a solution would really help. DOA for now - can't deploy.

0 likes
11 replies
tuneless's avatar
Level 2

Hello curtsheller, maybe this helps. Should be added to your composer.json file.

"repositories": [
    {
         "type": "composer", 
         "url": "https://packagist.org"
    },
    { "packagist": false }
]

But it is only a bypass and does not solve your problem. It's a workaround, so you can deploy.

jgreen's avatar

have you tried composer clear-cache? You might also double check permissions on ~/.composer path tree

curtsheller's avatar

Finally got a local, in the working directory copy working. I have no idea what is up. I'm thinking it's something when I updated the Mac OS to 10.10.4.

I did try learning the cache, reinstalling composer, validating the composer.json file.

I'll keep the suggestions in mind for the future.

Thanks,

Curt

curtsheller's avatar

Seems like it is an OpenSSL cert issue on my local Mac. found an error file in local dir that should help in fixing the issue.

joshreisner's avatar

I'm having this exact same issue, it just started randomly yesterday. Where did you look to see that error file?

joshreisner's avatar

So I was able to fix the problem by changing default_socket_timeout in php.ini to 120 (it was 60). I first tried it at -1, but this gave me an "Operation now in progress" error.

It's probably a topic for another thread, but it now takes an extremely long time to do anything in composer for some reason, so there is probably something else going on in my setup. How long? Running composer create-project laravel/laravel --prefer-dist --profile takes 24 minutes.

oldtimeguitarguy's avatar

I just experienced the same issue. I fixed it by doing the following:

sudo brew uninstall composer
sudo rm -Rf ~/.composer
sudo brew install composer
composer global require "laravel/installer=~1.1"

After that, I ran composer update in my project and it worked!

oldtimeguitarguy's avatar

Well that seemed to fix it temporarily, but it has reared its ugly head once again. I see an open issue on github for the same problem. Possibly related?

joshreisner's avatar

One way around this is to ssh into Homestead and run composer stuff from there.

joshreisner's avatar

Ah, I finally fixed this issue on my Mac. I've been using Homestead this whole time, but today thought I'd try Valet.

In case it helps anyone: what ended up working for me was I uninstalled PHP, and then reinstalled it like so:

brew install homebrew/php/php70 --with-homebrew-openssl

Please or to participate in this conversation.