-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phpbrew install and use not using the version installed nor listing the version #315
Comments
Ubuntu 14.04 . Apache 2.4 . |
What happens when you run |
hari@hari-Vostro-270s:~$ ~/.phpbrew/bashrc
hari@hari-Vostro-270s:~$ phpbrew list
Installed versions:
* (system)
hari@hari-Vostro-270s:~$ |
Strange. Have you installed with sudo? |
no sudo installations for php. |
Well, most of the time this issue was reported it was caused by some mistake during installation OR when people failed to Are you overwriting your $PATH somewhere? |
Not sure. The shell is zsh. I have added the details in ~/.zshrc and ~/.bashrc . |
Can you echo your
|
/var/www/github.com/harikt/Aura.Blog ± master echo $PATH
:/home/hari/.phpenv/bin:/home/hari/bin:/home/hari/Builds/elixir/bin:/usr/local/heroku/bin:/home/hari/.rvm/gems/ruby-2.0.0-p247/bin:/home/hari/.rvm/gems/ruby-2.0.0-p247@global/bin:/home/hari/.rvm/rubies/ruby-2.0.0-p247/bin:/home/hari/.rvm/bin:/usr/local/bin:/usr/local/sbin:/home/hari/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin
/var/www/github.com/harikt/Aura.Blog ± master which php
/usr/bin/php
/var/www/github.com/harikt/Aura.Blog ± master |
my suspicion is that your |
This hari@hari-Vostro-270s:~$ ~/.phpbrew/bashrc Should be
Which is different with |
Just to make sure what I have done so far PHPBREW_SET_PROMPT=1
source /home/hari/.phpbrew/bashrc is set in As mentioned by @c9s
|
ls ~/.phpbrew/build
php-5.3.22.tar.bz2 php-5.3.29 php-5.3.29.tar.bz2 php-5.4.33 php-5.4.33.tar.bz2 |
Is there anything in your |
Yup ~ ls ~/.phpbrew/php
php-5.3.22 php-5.3.29 php-5.4.33 |
That's weird, what happened to your |
What if you do If not, it should output the location of phar file |
which which phpbrew
phpbrew () {
if [[ -e bin/phpbrew ]]
then
BIN='bin/phpbrew'
else
BIN='phpbrew'
fi
local exit_status
local short_option
export SHELL
if [[ `echo $1 | awk 'BEGIN{FS=""}{print $1}'` = '-' ]]
then
short_option=$1
shift
else
short_option=""
fi
case $1 in
(use) if [[ -z "$2" ]]
then
if [[ -z "$PHPBREW_PHP" ]]
then
echo "Currently using system php"
else
echo "Currently using $PHPBREW_PHP"
fi
else
if [[ $2 =~ ^php- ]]
then
_PHP_VERSION=$2
else
s_esc="$(echo "$2" | sed 's/[^-A-Za-z0-9_]/\\&/g')"
_PHP_VERSION=$(ls -v $PHPBREW_ROOT/php | egrep "php-$s_esc.*" | tail -n 1)
fi
NEW_PHPBREW_PHP_PATH="$PHPBREW_ROOT/php/$_PHP_VERSION"
if [ -d $NEW_PHPBREW_PHP_PATH ]
then
code=$(command $BIN env $_PHP_VERSION)
if [ -z "$code" ]
then
exit_status=1
else
eval $code
__phpbrew_set_path
fi
else
echo "php version: $_PHP_VERSION not exists."
fi
fi ;;
(cd-src) local SOURCE_DIR=$PHPBREW_HOME/build/$PHPBREW_PHP
if [[ -d $SOURCE_DIR ]]
then
cd $SOURCE_DIR
fi ;;
(switch) if [[ -z "$2" ]]
then
echo "Please specify the php version."
else
__phpbrew_reinit $2
fi ;;
(lookup-prefix) if [[ -z "$2" ]]
then
if [[ -n $PHPBREW_LOOKUP_PREFIX ]]
then
echo $PHPBREW_LOOKUP_PREFIX
fi
else
export PHPBREW_LOOKUP_PREFIX=$(__phpbrew_set_lookup_prefix $2)
echo $PHPBREW_LOOKUP_PREFIX
__phpbrew_update_config
fi ;;
(install-pyrus) echo "Installing pyrus..."
cd $PHPBREW_BIN && wget --no-check-certificate -c http://pear2.php.net/pyrus.phar -O pyrus && chmod +x pyrus && cd -
hash -r ;;
(install-phpunit) echo "Installing phpunit..."
cd $PHPBREW_BIN && wget --no-check-certificate -c https://phar.phpunit.de/phpunit.phar -O phpunit && chmod +x phpunit && cd -
hash -r ;;
(install-composer) echo "Installing composer..."
cd $PHPBREW_BIN && wget --no-check-certificate -c http://getcomposer.org/composer.phar -O composer && chmod +x composer && cd -
hash -r ;;
(install-onion) echo "Installing onion..."
cd $PHPBREW_BIN
wget --no-check-certificate -c https://raw.github.com/c9s/Onion/master/onion -O onion
chmod +x onion
cd -
hash -r ;;
(cd) case $2 in
(var) local chdir=$PHPBREW_ROOT/php/$PHPBREW_PHP/var ;;
(etc) local chdir=$PHPBREW_ROOT/php/$PHPBREW_PHP/etc ;;
(dist) local chdir=$PHPBREW_ROOT/php/$PHPBREW_PHP ;;
(build) local chdir=$PHPBREW_ROOT/build/$PHPBREW_PHP ;;
(*) echo "$2 not found"
return 0 ;;
esac
echo "Switching to $chdir, run 'cd -' to go back."
cd $chdir
return 0 ;;
(clean) local _VERSION=$2
if [[ -z $_version ]]
then
_VERSION=$PHPBREW_PHP
fi
echo "Cleaning up $_VERSION build directory..."
local build_dir=$PHPBREW_ROOT/build/$_VERSION
echo "build_dir=$build_dir"
if [[ -e $build_dir ]]
then
cd $build_dir && make clean && cd -
fi ;;
(fpm) PHPFPM_BIN=$PHPBREW_ROOT/php/$PHPBREW_PHP/sbin/php-fpm
PHPFPM_PIDFILE=$PHPBREW_ROOT/php/$PHPBREW_PHP/var/run/php-fpm.pid
mkdir -p $PHPBREW_ROOT/php/$PHPBREW_PHP/var/run
fpm_start () {
echo "Starting php-fpm..."
$PHPFPM_BIN --php-ini $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php.ini --fpm-config $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php-fpm.conf --pid $PHPFPM_PIDFILE ${*:3}
if [[ $? != "0" ]]
then
echo "php-fpm start failed."
fi
}
fpm_stop () {
if [[ -e $PHPFPM_PIDFILE ]]
then
echo "Stopping php-fpm..."
kill $(cat $PHPFPM_PIDFILE)
rm -i -f $PHPFPM_PIDFILE
fi
}
case $2 in
(start) fpm_start ;;
(stop) fpm_stop ;;
(restart) fpm_stop
fpm_start ;;
(module) $PHPFPM_BIN --php-ini $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php.ini --fpm-config $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php-fpm.conf -m | less ;;
(info) $PHPFPM_BIN --php-ini $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php.ini --fpm-config $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php-fpm.conf -i ;;
(config) if [[ -n $EDITOR ]]
then
$EDITOR $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php-fpm.conf
else
echo "Please set EDITOR environment variable for your favor."
nano $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php-fpm.conf
fi ;;
(help) $PHPFPM_BIN --php-ini $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php.ini --fpm-config $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php-fpm.conf --help ;;
(test) $PHPFPM_BIN --php-ini $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php.ini --fpm-config $PHPBREW_ROOT/php/$PHPBREW_PHP/etc/php-fpm.conf --test ;;
(*) echo "Usage: phpbrew fpm [start|stop|restart|module|test|help|config]" ;;
esac ;;
(env) if [[ -n "$2" ]]
then
export PHPBREW_PHP=$2
fi
echo "export PHPBREW_ROOT=$PHPBREW_ROOT"
echo "export PHPBREW_HOME=$PHPBREW_HOME"
if [[ -n $PHPBREW_LOOKUP_PREFIX ]]
then
echo "export PHPBREW_LOOKUP_PREFIX=$PHPBREW_LOOKUP_PREFIX"
fi
if [[ -n $PHPBREW_PHP ]]
then
echo "export PHPBREW_PHP=$PHPBREW_PHP"
echo "export PHPBREW_PATH=$PHPBREW_ROOT/php/$PHPBREW_PHP/bin"
fi ;;
(off) unset PHPBREW_PHP
unset PHPBREW_PATH
eval `$BIN env`
__phpbrew_set_path
echo "phpbrew is turned off." ;;
(switch-off) unset PHPBREW_PHP
unset PHPBREW_PATH
eval `$BIN env`
__phpbrew_set_path
__phpbrew_reinit
echo "phpbrew is switched off." ;;
(remove) if [[ -z "$2" ]]
then
command $BIN help
else
__phpbrew_remove_purge $2
fi ;;
(rehash) echo "Rehashing..."
. ~/.phpbrew/bashrc ;;
(purge) if [[ -z "$2" ]]
then
command $BIN help
else
__phpbrew_remove_purge $2 purge
fi ;;
(*) command $BIN $short_option "$@"
exit_status=$? ;;
esac
hash -r
return ${exit_status:-0}
} |
you may see what's the path phpbrew is using. cc @marcioAlmada I think we need to provide a debug instruction guide to wiki to solve problems more efficiently. |
Hi @harikt, for my, my result:
|
echo $PHPBREW_ROOT
/home/hari/.phpbrew
/var/www/github.com/harikt/rtdocs echo $PHPBREW_HOME
/home/hari/.phpbrew |
Hi @harikt , That's really really weird, if you run What if you run Pedro |
My suspicion: https://github.com/phpbrew/phpbrew/blob/develop/src/PhpBrew/Config.php#L101 I guess you don't have
|
If you have something like |
@c9s your assumption about bin directory is correct. phpbrew list
Installed versions:
* (system)
/var/www/github.com/harikt/rtdocs phpbrew self-update
Updating phpbrew /usr/bin/phpbrew from master...
Version updated.
Phpbrew environment is initialized, required directories are created under
/home/hari/.phpbrew
Paste the following line(s) to the end of your ~/.bashrc and start a
new shell, phpbrew should be up and fully functional from there:
source /home/hari/.phpbrew/bashrc
To enable PHP version info in your shell prompt, please set PHPBREW_SET_PROMPT=1
in your `~/.bashrc` before you source `~/.phpbrew/bashrc`
export PHPBREW_SET_PROMPT=1
For further instructions, simply run `phpbrew` to see the help message.
Enjoy phpbrew at $HOME!!
phpbrew - 1.14.2
cliframework core: 1.5.12
/var/www/github.com/harikt/rtdocs ls -la ~/.phpbrew/php/php-5.3.29/bin
ls: cannot access /home/hari/.phpbrew/php/php-5.3.29/bin: No such file or directory
✘ /var/www/github.com/harikt/rtdocs ls -la ~/.phpbrew/php/php-5.3.22
total 8
drwxr-xr-x 2 hari hari 4096 Oct 1 11:06 .
drwxr-xr-x 5 hari hari 4096 Oct 1 11:25 .. |
ls -la ~/.phpbrew/php/php-5.3.29
total 12
drwxr-xr-x 2 hari hari 4096 Oct 1 11:14 .
drwxr-xr-x 5 hari hari 4096 Oct 1 11:25 ..
-rw-rw-r-- 1 hari hari 94 Oct 1 12:21 phpbrew.variants
|
So your PHP 5.3 didn't install successfully. I just tried php 5.3.29, it does not work for me either. |
I guess we need some patch for PHP 5.3 on Mac OS X.. :( |
@c9s I am from Ubuntu 👍 . |
did 5.4 work for you? |
nope. |
OK, can you gist the build log ? e.g. |
Interesting no logs. |
@marcioAlmada do you have any idea about this? didn't know if something break the installation. |
I guess it's caused by 933d09e, we redirect all the messages to the log file, and we don't know what causes the build failing. |
OK, I just got an Ubuntu and just ran the build. here is my result:
You can see there is a libtool error:
|
Looks like related to #83, and related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47390 I guess |
@harikt , |
@harikt looks like try: the command above works for me. |
phpbrew -d 5.3 +default+intl
Command 5.3 not found. phpbrew list Works now for 5.4 👍 after installation. |
Oh, I missed a "install" command, sorry, it should be:
|
installing 5.3.29 is failing for me also (On Mac 10.9.5). Here is the output from install (i'm using a yaml config but i also tried with just
|
here is the output of build.log: https://gist.github.com/mattcdavis1/4a15e5c95a047bd2762a |
hi @mattcdavis1 , right now it's a Mac OS only issue, because of:
Which is something we can't solve in phpbrew, but might work if we get some patches for this. |
OK, I found that |
|
Hi @harikt, Sorry, my mistake, the command should be:
|
@c9s yes you did gave me the answer :) . May be close this or is this an issue with the installation ? |
Yeah I think we may close this issue. If you need any support, just fire an issue, I am glad to help. |
Thank you. Hari K T You can ring me : +91 9388 75 8821 http://harikt.com , https://github.com/auraphp , Skype : kthari85 On Mon, Oct 6, 2014 at 12:11 PM, Yo-An Lin notifications@github.com wrote:
|
yep - installing 5.3.29 works great after phpbrew self-update. Thanks! |
@c9s+++ Hey, do you think we should add |
Oh, I read the full story, we have #319 already. |
Yeah, we should do that. :-) maybe for the next 1.14 patch version? what do you think? |
The text was updated successfully, but these errors were encountered: