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

zachman's avatar

Composer V. 2 Wont stay at V. 2 between sessions

So I have a forge dev server. I spent some time trying to find out why my composer wont update. Just had to sudo the command. But when I logout of my server (from VS Code Remote Server Connection) my composer goes back to old 1.x version.

Has anyone come across this?

0 likes
5 replies
bugsysha's avatar

My server came with composer self-update --1 cron job so I didn't have any issues.

zachman's avatar

So I sudo composer selfupdate run a composer update all good and super fast. I close my connection to my server in VS code and the next day login and run a composer update only for it to take forever. So I composer --version and its back to 1.x.

I'm wondering if it has to do with the fact that I need to run sudo. Maybe it's not actually updating /usr/local/bin/composer?

zachman's avatar

Ah I missed that. It worked! Thanks!

Please or to participate in this conversation.