How can I easily switch between PHP versions on Mac OSX?

后端 未结 6 1954
旧巷少年郎
旧巷少年郎 2020-12-04 13:28

I would like to test my application on PHP 5.3 up to PHP 7.0.

Where and how can I install the versions and how can I switch them by running a small script?

6条回答
  •  一向
    一向 (楼主)
    2020-12-04 14:08

    Using brew

    Show current version

    $ php -v
    

    Change to different version
    (eg. changing from 5.5.x to version 7.0.latest) :

    $ brew unlink php55
    $ brew install php70
    

提交回复
热议问题