Open visualasparagus opened 10 years ago
I'll try to look at this issue ASAP. Thanks for reporting.
Same error here, but with php-5.4.27
Same here
Can someone provide a full stack trace by running with -v
flag ? Thanks :)
Sure.
php switch -v php-5.4.8
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "enabled, mirror" under "phpswitch"
Exception trace:
() at /usr/share/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php:316
Symfony\Component\Config\Definition\ArrayNode->normalizeValue() at /usr/share/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php:268
Symfony\Component\Config\Definition\BaseNode->normalize() at /usr/share/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php:33
Symfony\Component\Config\Definition\Processor->process() at /usr/share/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php:50
Symfony\Component\Config\Definition\Processor->processConfiguration() at /usr/share/phpswitch/src/jubianchi/PhpSwitch/Configuration/Validator.php:28
jubianchi\PhpSwitch\Configuration\Validator->validate() at /usr/share/phpswitch/src/jubianchi/PhpSwitch/Configuration.php:104
jubianchi\PhpSwitch\Configuration->doRead() at /usr/share/phpswitch/src/jubianchi/PhpSwitch/Configuration.php:152
jubianchi\PhpSwitch\Configuration->has() at /usr/share/phpswitch/src/jubianchi/PhpSwitch/Configuration/Collection.php:40
jubianchi\PhpSwitch\Configuration\Collection->get() at /usr/share/phpswitch/src/jubianchi/PhpSwitch/Console/Command/PHP/SwitchCommand.php:54
jubianchi\PhpSwitch\Console\Command\PHP\SwitchCommand->execute() at /usr/share/phpswitch/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:240
Symfony\Component\Console\Command\Command->run() at /usr/share/phpswitch/vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at /usr/share/phpswitch/src/jubianchi/PhpSwitch/Console/Application.php:143
jubianchi\PhpSwitch\Console\Application->doRun() at /usr/share/phpswitch/vendor/symfony/console/Symfony/Component/Console/Application.php:106
Symfony\Component\Console\Application->run() at /usr/share/phpswitch/src/jubianchi/PhpSwitch/PhpSwitch.php:61
jubianchi\PhpSwitch\PhpSwitch->run() at /usr/share/phpswitch/bin/phpswitch:26
php:switch [-a|--apache2] [-s|--save] version
php switch [-a|--apache2] [-s|--save] version
@visualasparagus Thanks I'm already working on the fix and I have something working in my local branch.
I'll test it a bit more and try to push it asap ;)
Any luck?
@jubianchi Hi, i'm affected to. Waiting your commit impatiently : )
The trace just in case:
php switch -v php-5.4.8
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "enabled, mirror" under "phpswitch"
Exception trace:
() at /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php:316
Symfony\Component\Config\Definition\ArrayNode->normalizeValue() at /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php:268
Symfony\Component\Config\Definition\BaseNode->normalize() at /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php:33
Symfony\Component\Config\Definition\Processor->process() at /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php:50
Symfony\Component\Config\Definition\Processor->processConfiguration() at /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/Configuration/Validator.php:28
jubianchi\PhpSwitch\Configuration\Validator->validate() at /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/Configuration.php:104
jubianchi\PhpSwitch\Configuration->doRead() at /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/Configuration.php:152
jubianchi\PhpSwitch\Configuration->has() at /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/Configuration/Collection.php:40
jubianchi\PhpSwitch\Configuration\Collection->get() at /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/Console/Command/PHP/SwitchCommand.php:54
jubianchi\PhpSwitch\Console\Command\PHP\SwitchCommand->execute() at /home/bsevajol/phpswitch/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:240
Symfony\Component\Console\Command\Command->run() at /home/bsevajol/phpswitch/vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/Console/Application.php:143
jubianchi\PhpSwitch\Console\Application->doRun() at /home/bsevajol/phpswitch/vendor/symfony/console/Symfony/Component/Console/Application.php:106
Symfony\Component\Console\Application->run() at /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/PhpSwitch.php:61
jubianchi\PhpSwitch\PhpSwitch->run() at /home/bsevajol/phpswitch/bin/phpswitch:26
php:switch [-a|--apache2] [-s|--save] version
php switch [-a|--apache2] [-s|--save] version
Hi sorry for the delay.
I pushed a branch called configuration
which should hopefully fix the issue.
Before getting this working you will have to run bin/phpswitch init
and source the ~/.phpswitch/.phpswitchrc
script as things changed a bit.
Tests are failing on the branch because of the way local and global PHP installation are handled has changed. I'm working on it.
Hi, thank you for your work! I did'nt pull your branch yet: the bug has "disapear". I don't understand ... my terminal has not be closed i've just wait 2 hours.
If the bug appear again i will try to search why and try your branch.
@buxx The way PHP versions were managed was not good, it has too many problems:
.phpswitch.yml
was modified by phpswitch commands which is not good given it's a comitted file and it should not changed without explicit user validationenabled
switch for local and/or global PHP was sometimes wrongThe new configuration model should fix everything:
~/.phpswitch.yml
to store local configurationsenabled
switch should also be computed correctly, following these rules:
global.enabled
and no local phpswitch.yml
file is found, then the global version is appliedglobal.enabled
is false and no local phpswitch.yml
file is found, then the system default version is appliedglobal.enabled
, a local phpswitch.yml
is found and local.enabled
then the local version is appliedglobal.enabled
, a local phpswitch.yml
is found and local.enabled
is false then the global version is appliedglobal.enabled
, a local phpswitch.yml
is found and local.enabled
is false then the global version is appliedglobal.enabled
is false, a local phpswitch.yml
is found and local.enabled
is false then the system default version is appliedBut i'm not sure to have correctly use your changes. I've checkout the phpswitch repository and do the phpswitch init
, but:
PHP Fatal error: Uncaught exception 'Symfony\Component\Config\Definition\Exception\InvalidConfigurationException' with message 'Unrecognized options "enabled, mirror" under "phpswitch"' in /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php:316
Stack trace:
#0 /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php(268): Symfony\Component\Config\Definition\ArrayNode->normalizeValue(Array)
#1 /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php(33): Symfony\Component\Config\Definition\BaseNode->normalize(Array)
#2 /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php(50): Symfony\Component\Config\Definition\Processor->process(Object(Symfony\Component\Config\Definition\ArrayNode), Array)
#3 /home/bsevajol/phpswitch/src/jubianchi/PhpSwitch/Configuration/Validator.php(28): Symfony\Component\Config\Definition\Processor->processConfiguration(Object(jubianchi\PhpS in /home/bsevajol/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php on line 316
So i sudo php installer
with the installer of your configuration
branch to re-install all. And i still have the error. Sorry if i do it wrong !
@buxx The installer always uses the defaut branch, which is master
.
I'll add an option to select another branch.
@jubianchi So I'm not sure how to update to your configuration branch then. I removed everything and reinstalled using the following, but if the installer always pulls master then I guess it's not going to work, right?
curl https://raw.github.com/jubianchi/phpswitch/configuration/bin/installer | sudo php -- --global
Also, when I run phpswitch init
it always installs into my home directory and not into /usr/share/phpswitch/
like the docs say.
Thanks again for your work.
@visualasparagus The init
is always done at a user level, putting everything in the home directory of the user running the init
command.
I'll make the doc clear on this point.
@jubianchi I've pulled in the configuration branch myself and although I don't get the error, the switch isn't actually working. This is what I did.
cd /usr/share/phpswitch
sudo git fetch origin
sudo git reset --hard origin/configuration
sudo rm -R ~/.phpswitch
sudo rm ~/.phpswitch.yml
source ~/.phpswitch/.phpswitchrc
phpswitch init
the .phpswitch.yml file is never recreated though, which I guess is correct as my installation used --global, right?
phpswitch php:install 5.4.8 --default
But then when I do php switch php-5.4.8
it says it switched but it really doesn't
Global PHP switched to php-5.4.8
PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Am I doing something wrong?
@visualasparagus You sourced ~/.phpswitch/.phpswitchrc
before the phpswitch init
when you should have done it after.
Could you try running the switch command in a new, fresh shell (the right version of ~/.phpswitch/.phpswitchrc
will be source) ?
@jubianchi I've done that but am having exactly the same problem. It still says it switches, but it doesn't.
Is there anything I can do to help troubleshoot this?
ping ? i have same here :')
I'll be on this issue in a few days and hopefully i'll fix it.
Awesome i am waiting for it :-)
Envoyé de mon iPad
mardi 15 juillet 2014 16:14 +0200 de Julien BIANCHI notifications@github.com: I'll be on this issue in a few days and hopefully i'll fix it. — Reply to this email directly or view it on GitHub .
Sorry I closed the issue but did not fixed it :/
I've been trying to install php using phpswitch, however, I'm getting the following error when I try to run
I'm running OSX version 10.9.2