jubianchi / phpswitch

A CLI utility to help you build and test PHP versions
http://jubianchi.github.io/phpswitch/
MIT License
90 stars 8 forks source link

Unable to install properly #8

Closed lyrixx closed 11 years ago

lyrixx commented 11 years ago

I installed it in /opt/phpswich/phpswitch. I'am on 3f672fa

>root@greg-laptop[/opt/phpswich/phpswitch](master) php switch on
>root@greg-laptop[/opt/phpswich/phpswitch](master) echo $?
1

and

>root@greg-laptop[/opt/phpswich/phpswitch](master) ./bin/phpswitch php:switch php-5.4.12
PHP switched to php-5.4.12
>root@greg-laptop[/opt/phpswich/phpswitch](master) php -v
PHP 5.4.6-1ubuntu1.1 (cli) (built: Nov 15 2012 01:23:47) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

Doest I miss something ?

jubianchi commented 11 years ago

The php switch on command seems to be failing due to an error. I think you missed a phpswitch init which has to be done after each update (I have to document this and/or improve the update process to do it automatically). After that, you will be asked to source the script (with your install, it shuld live in /opt/phpswich/phpswitch/.phpswitch/.phpswitchrc

After that, the php switch on command should display potential errors.

Let me know if you find something more so that I can fix the bug ASAP ;)

Thanks

lyrixx commented 11 years ago

Yes, I did it (again):

>root@greg-laptop[/opt/phpswich/phpswitch](master) ./bin/phpswitch init
Directory /opt/phpswich/phpswitch/.phpswitch already exists
Directory /opt/phpswich/phpswitch/.phpswitch/downloads already exists
Directory /opt/phpswich/phpswitch/.phpswitch/sources already exists
Directory /opt/phpswich/phpswitch/.phpswitch/installed already exists
Directory /opt/phpswich/phpswitch/.phpswitch/doc already exists
You should source /opt/phpswich/phpswitch/.phpswitch/.phpswitchrc to use phpswitch
>root@greg-laptop[/opt/phpswich/phpswitch](master) source /opt/phpswich/phpswitch/.phpswitch/.phpswitchrc
>root@greg-laptop[/opt/phpswich/phpswitch](master) php switch on
>root@greg-laptop[/opt/phpswich/phpswitch](master) echo $?
1
jubianchi commented 11 years ago

This should be fixed now :

# Update phpswitch
$ curl https://raw.github.com/jubianchi/phpswitch/master/bin/installer | PHPSWITCH_PATH=/opt/phpswich sudo php

# Reinitialize phpswitch
$ phpswitch init
$ source /opt/phpswich/phpswitch/.phpswitch/.phpswitchrc

$ php switch on
PHP 5.4.9 (cli) (built: Jan 23 2013 14:19:12) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
lyrixx commented 11 years ago

Thanks ;)

php switch on works.

BTW, i use git to grab your code ;)

jubianchi commented 11 years ago

ok great! thanks for your feedback and sorry for the fail :)