symfony error message "Binary replacement failed, rename /usr/local/bin/symfony /usr/local/bin/__symfony__bak ..."

Viewed 1057

My symfony's version does not want to update, when I do a symfony -v, this message appears:

"Binary replacement failed, rename /usr/local/bin/symfony /usr/local/bin/__symfony__bak: permission denied. Rollback and continue".

I manually tried to rename: sudo mv /usr/local/bin/symfony /usr/local/bin/__symfony__ (two dashes before and after the "symfony") , or sudo mv /usr/local/bin/symfony /usr/local/bin/__symfony

But it does not work,

what should I actually do? Thanks for your help

2 Answers

What I did was...

Give all permissions to folder:

chmod a+rwx /usr/local/bin

Then went to the folder and changed the name of the symfony file to "__symfony__bak:" without quotations.

Then wrote a command that triggered the update installation. In my case:

symfony server:start

This message popped up:

bash: /usr/local/bin/symfony: No such file or directory

Then changed the name of the file back to "symfony" without quotations.

Then wrote the same command again.

symfony server:start

In this case the installation was successful and no error message popped up.

And it worked! I hope it works for you as well if you didn't fix it already.

My Solution

I had the same issue with

symfony check:requirements

Simple use sudo-command and problem was solved

sudo symfony check:requirements
Related