Phpbrew: function __phpbrew_set_path() - ~/.phpbrew/bashrc: line 17: syntax error near unexpected token `$'\r''

Created on 30 Oct 2016  路  6Comments  路  Source: phpbrew/phpbrew

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

Output

~/.phpbrew/bashrc: line 17: syntax error near unexpected token$'\r''`

Command

phpbrew --debug switch x.x.x
and
source ~/.phpbrew/bashrc

Build Log

OS:

WSL Ubuntu 16.04

On revision: 3819e0a

Most helpful comment

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

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sam452 picture sam452  路  6Comments

rsantellan picture rsantellan  路  3Comments

jibran picture jibran  路  3Comments

sam452 picture sam452  路  3Comments

flik picture flik  路  4Comments