When running phpbrew switch It errors stating:
You should not see this, if you see this, it means you didn't load the ~/.phpbrew/bashrc script, please check if bashrc is sourced in your shell.
So I ran the command: source ~/.phpbrew/bashrc which resulted in:
: command not found
: command not found
: command not found
bash: /home/portchris/.phpbrew/bashrc: line 17: syntax error near unexpected token `$'\r''
'ash: /home/portchris/.phpbrew/bashrc: line 17: `function __phpbrew_set_path()
I cannot locate this carrige return however when opening bashrc shell script is not my specialty so any help would be much appreciated.
Many thanks
~/.phpbrew/bashrc: line 17: syntax error near unexpected token$'\r''`
phpbrew --debug switch x.x.x
and
source ~/.phpbrew/bashrc
OS:
WSL Ubuntu 16.04
On revision: 3819e0a
Ended up installing dos2unix and running that on my bashrc file and it has resolved my issue.
I assume this is related to me using WSL Bash. See here for more info. .
Then I ran source ~/.phpbrew/bashrc and voila! I can now use and switch.
Hope this helps anybody else installing multiple versions of PHP on Windows Bash
@portchris
Why did you close? It is still an existing bug. Looks like some CRLF made it into the bashrc.
@akomm yes, I'm still looking for what happened, and I already fixed this bug at the same time, see #809
Superb :)
Sorry guys, yes I marked this as been solved after I perfomed a dos2unix on the bashrc, I believe it was some Windows Carrige Returns.
@jhdxr I read #809 do you recommend I phpbrew self-update myself? I am running version 1.22.5.
@portchris yep, I updated the phar file and it should work fine now.
Most helpful comment
Ended up installing
dos2unixand running that on mybashrcfile and it has resolved my issue.I assume this is related to me using WSL Bash. See here for more info. .
Then I ran
source ~/.phpbrew/bashrcand voila! I can nowuseandswitch.Hope this helps anybody else installing multiple versions of PHP on Windows Bash