"You should not see this, please check if bashrc is sourced in your shell." when using phpbrew inside shell script #167

Closed
alanhartless opened this Issue Jan 11, 2014 · 5 comments

Comments

Projects
None yet
4 participants
@alanhartless

How do I get phpbrew functional from within a shell script ran by root? When I try to use phpbrew inside the script, I get:

You should not see this, please check if bashrc is sourced in your shell.

Thanks!
Alan

@c9s

This comment has been minimized.

Show comment
Hide comment
@c9s

c9s Jan 11, 2014

Member

sudo as root, then run:

 phpbrew init

then make sure to source the script in your root environment.

Member

c9s commented Jan 11, 2014

sudo as root, then run:

 phpbrew init

then make sure to source the script in your root environment.

@bretterer

This comment has been minimized.

Show comment
Hide comment
@bretterer

bretterer Jan 12, 2014

I have this issue as well.. My use case is I am using phpbrew for a gitlab_ci runner. I need to be able to run this from a non root user. Is this possible?

I have this issue as well.. My use case is I am using phpbrew for a gitlab_ci runner. I need to be able to run this from a non root user. Is this possible?

@c9s

This comment has been minimized.

Show comment
Hide comment
@c9s

c9s Jan 13, 2014

Member

You may put ~/.phpbrew/bashrc in your /etc and preload the phpbrew bashrc from /etc/profile, so non-root users share the same phpbrew function but using different phpbrew config.

Member

c9s commented Jan 13, 2014

You may put ~/.phpbrew/bashrc in your /etc and preload the phpbrew bashrc from /etc/profile, so non-root users share the same phpbrew function but using different phpbrew config.

@bretterer

This comment has been minimized.

Show comment
Hide comment
@bretterer

bretterer Jan 13, 2014

@c9s tried that... maybe im doing it wrong... i ran as root

cp ~/.phpbrew/ /etc/
vi /etc/profile
added `source /etc/.phpbrew/bashrc`

su gitlab_ci_runner

gitlab_ci_runner@gitlab:/root$ source /etc/.phpbrew/bashrc
mkdir: cannot create directory `/root/.phpbrew': Permission denied
mkdir: cannot create directory `/root/.phpbrew': Permission denied
mkdir: cannot create directory `/root': Permission denied

@c9s tried that... maybe im doing it wrong... i ran as root

cp ~/.phpbrew/ /etc/
vi /etc/profile
added `source /etc/.phpbrew/bashrc`

su gitlab_ci_runner

gitlab_ci_runner@gitlab:/root$ source /etc/.phpbrew/bashrc
mkdir: cannot create directory `/root/.phpbrew': Permission denied
mkdir: cannot create directory `/root/.phpbrew': Permission denied
mkdir: cannot create directory `/root': Permission denied
@bretterer

This comment has been minimized.

Show comment
Hide comment
@bretterer

bretterer Jan 13, 2014

https://github.com/c9s/phpbrew/wiki/Cookbook#install-phpbrew-into-system-wide-environment

This link does what i need... I was not able to find it before this issue

https://github.com/c9s/phpbrew/wiki/Cookbook#install-phpbrew-into-system-wide-environment

This link does what i need... I was not able to find it before this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment