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

Invalid type for path "phpswitch.versions.php_5_4_11 #11

Closed lyrixx closed 11 years ago

lyrixx commented 11 years ago

I wanted to give another try to phpswitch but I got some errors:

>root@greg-laptop[/opt/phpswitch](master) git fetch 
>root@greg-laptop[/opt/phpswitch](master) git reset --hard origin/master 
HEAD is now at f2160e8 Add GMP, Enchant and ZTS options
>root@greg-laptop[/opt/phpswitch](master) composer install --dev
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
>root@greg-laptop[/opt/phpswitch](master) bin/phpswitch 
PHP Fatal error:  Uncaught exception 'Symfony\Component\Config\Definition\Exception\InvalidTypeException' with message 'Invalid type for path "phpswitch.versions.php_5_4_11". Expected array, but got string' in /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php:277
Stack trace:
#0 /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php(265): Symfony\Component\Config\Definition\ArrayNode->validateType('--enable-libxml...')
#1 /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php(283): Symfony\Component\Config\Definition\BaseNode->normalize('--enable-libxml...')
#2 /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php(268): Symfony\Component\Config\Definition\PrototypedArrayNode->normalizeValue(Array)
#3 /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php(308): Symfony\Component\Config\Definition\BaseNode->normalize(Array)
#4 /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php(268): Symfony\Component\Config\Definition\ArrayNode->normalizeValue(Array)
#5 /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php(33): Symfony\Component\Config\Definition\BaseNode->normalize(Array)
#6 /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php(50): Symfony\Component\Config\Definition\Processor->process(Object(Symfony\Component\Config\Definition\ArrayNode), Array)
#7 /opt/phpswitch/src/jubianchi/PhpSwitch/Config/Validator.php(66): Symfony\Component\Config\Definition\Processor->processConfiguration(Object(jubianchi\PhpSwitch\Config\Validator), Array)
#8 /opt/phpswitch/src/jubianchi/PhpSwitch/Config/Loader.php(79): jubianchi\PhpSwitch\Config\Validator->validate(Array)
#9 /opt/phpswitch/src/jubianchi/PhpSwitch/PhpSwitch.php(166): jubianchi\PhpSwitch\Config\Loader->load('.phpswitch.yml', Object(jubianchi\PhpSwitch\Config\Configuration), Object(jubianchi\PhpSwitch\Config\Dumper))
#10 /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php(122): jubianchi\PhpSwitch\PhpSwitch->jubianchi\PhpSwitch\{closure}(Object(Pimple))
#11 /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php(83): Pimple::{closure}(Object(Pimple))
#12 /opt/phpswitch/src/jubianchi/PhpSwitch/PhpSwitch.php(98): Pimple->offsetGet('app.config')
#13 /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php(122): jubianchi\PhpSwitch\PhpSwitch->jubianchi\PhpSwitch\{closure}(Object(Pimple))
#14 /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php(83): Pimple::{closure}(Object(Pimple))
#15 /opt/phpswitch/src/jubianchi/PhpSwitch/PhpSwitch.php(57): Pimple->offsetGet('app')
#16 /opt/phpswitch/bin/phpswitch(26): jubianchi\PhpSwitch\PhpSwitch->run()
#17 {main}
  thrown in /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php on line 277

Fatal error: Uncaught exception 'Symfony\Component\Config\Definition\Exception\InvalidTypeException' with message 'Invalid type for path "phpswitch.versions.php_5_4_11". Expected array, but got string' in /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php on line 277

Symfony\Component\Config\Definition\Exception\InvalidTypeException: Invalid type for path "phpswitch.versions.php_5_4_11". Expected array, but got string in /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php on line 277

Call Stack:
    0.0002     119592   1. {main}() /opt/phpswitch/bin/phpswitch:0
    0.0039     272440   2. jubianchi\PhpSwitch\PhpSwitch->run() /opt/phpswitch/bin/phpswitch:26
    0.0039     272492   3. Pimple->offsetGet() /opt/phpswitch/bin/phpswitch:57
    0.0039     272520   4. Pimple::{closure:/opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php:118-126}() /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php:83
    0.0039     272548   5. jubianchi\PhpSwitch\PhpSwitch->jubianchi\PhpSwitch\{closure}() /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php:122
    0.0553    1851936   6. Pimple->offsetGet() /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php:98
    0.0554    1851964   7. Pimple::{closure:/opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php:118-126}() /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php:83
    0.0554    1851992   8. jubianchi\PhpSwitch\PhpSwitch->jubianchi\PhpSwitch\{closure}() /opt/phpswitch/vendor/pimple/pimple/lib/Pimple.php:122
    0.0565    1890028   9. jubianchi\PhpSwitch\Config\Loader->load() /opt/phpswitch/src/jubianchi/PhpSwitch/PhpSwitch.php:166
    0.0639    2084640  10. jubianchi\PhpSwitch\Config\Validator->validate() /opt/phpswitch/src/jubianchi/PhpSwitch/Config/Loader.php:79
    0.0642    2092136  11. Symfony\Component\Config\Definition\Processor->processConfiguration() /opt/phpswitch/src/jubianchi/PhpSwitch/Config/Validator.php:66
    0.0702    2416124  12. Symfony\Component\Config\Definition\Processor->process() /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php:50
    0.0702    2416404  13. Symfony\Component\Config\Definition\BaseNode->normalize() /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php:33
    0.0702    2416556  14. Symfony\Component\Config\Definition\ArrayNode->normalizeValue() /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php:268
    0.0703    2417212  15. Symfony\Component\Config\Definition\BaseNode->normalize() /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php:308
    0.0703    2417364  16. Symfony\Component\Config\Definition\PrototypedArrayNode->normalizeValue() /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php:268
    0.0703    2418080  17. Symfony\Component\Config\Definition\BaseNode->normalize() /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php:283
    0.0703    2418080  18. Symfony\Component\Config\Definition\ArrayNode->validateType() /opt/phpswitch/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php:265
lyrixx commented 11 years ago

Note: I moved phpswitch. May be this is an issue.

Not related but, can I open an issue to support php-fpm ?

jubianchi commented 11 years ago

Hi! Thanks or the report :)

Unfortunatelly, this is a known issue introduced by a BC break some times ago : the .phpswitch.yml format as been modified to be more human readable.

What you will have to do to make everything work again is to delete your ~/.phpswitch.yml (or any other configuration file in projects directories). Unfortunatelly, this will makr you loose all your PHP preset. If you want to keep them, you'll have to migrate the manually.

lyrixx commented 11 years ago

Thanks. But I already deleted this file. Still the same issue. More over, I remove and re-installer phpswitch from scratch

lyrixx commented 11 years ago

Ok I got the file. But I do not like it :( Your application look at for file in /.phpswitch.yml

Strace log:

stat64("/root/.phpswitch.yml", 0xbf973340) = -1 ENOENT (No such file or directory)
gettimeofday({1371379458, 10031}, NULL) = 0
gettimeofday({1371379458, 10099}, NULL) = 0
gettimeofday({1371379458, 10269}, NULL) = 0
gettimeofday({1371379458, 10406}, NULL) = 0
stat64("/.phpswitch.yml", {st_mode=S_IFREG|0644, st_size=484, ...}) = 0
jubianchi commented 11 years ago

phpswitch looks for a configuration file from the CWD to the toplevel root, merging found files together. It also looks for a file in the home directory of the current user. This is a known behavior: https://github.com/jubianchi/phpswitch/blob/master/src/jubianchi/PhpSwitch/PhpSwitch.php#L172-L178

lyrixx commented 11 years ago

Ok thanks.

jubianchi commented 11 years ago

PS: If you have any suggestion to improve this behavior, I'll be glad to hear it and make phpswitch better :)

lyrixx commented 11 years ago

Ok. No problem. I tried phpswitch few month ago, but It did not worked well. So I want to give another try ;) But I use a different stack than you (nginx, fpm). If everything work well with CLI, it would be very nice to have a support for php-fpm. BTW, If you want help to , you can ask me ;)

jubianchi commented 11 years ago

Ho great to hear that you are using a different stack :) It would be great to also support this one. Unfortunatelly, apache2 support is a bit experimental ATM and I have to work on it to make it stable and usable.

If you have any other issue with phpswitch, please, do not hesitate to fill some issues, I'll be really glad to fix them and as I said, improve the tool.

thanks again :smile: