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

后端 未结 6 1952
旧巷少年郎
旧巷少年郎 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 13:52

    Example: Let us switch from php 7.4 to 7.3

    brew unlink php@7.4
    brew install php@7.3
    brew link php@7.3
    

    If you get Warning: php@7.3 is keg-only and must be linked with --force Then try with:

    brew link php@7.3 --force
    

提交回复
热议问题