Does php have an equivalent to python's virtualenv or ruby's sandbox?

前端 未结 8 1041
遇见更好的自我
遇见更好的自我 2020-12-24 10:42

I\'m used to using python\'s virtualenv tool to create separate environments that can mimic deployment environments for projects I write.

Now, I\'m going to be worki

相关标签:
8条回答
  • 2020-12-24 11:41

    (Haven't coded php in years, so this might be outdated)

    As far as I remember you just had to point to another directory where your libraries reside (include PATH), using something like:

    include_path = .:/usr/local/lib/php:./include (this goes in php.ini, default libararies)
    

    and in your php files:

    ini_set("include_path", ".:../:./include:../include");
    

    PHP never really had a robust packaging system and library repository like perl/python/ruby has, PEAR was trying to move in that direction but it is very closed in comparison and was hard to configure in multiproject environments.

    Phark is trying to build a brew/bundler port for php, https://github.com/lox/phark, although it's not deployment ready.

    0 讨论(0)
  • 2020-12-24 11:42

    You might be interested in this: https://github.com/phpenv/phpenv

    0 讨论(0)
提交回复
热议问题