How can I get PHP working again in the command line?

前端 未结 5 1542
再見小時候
再見小時候 2020-12-08 11:54

I\'m completely at loss here and am about to wipe my hard drive clean and start from a fresh OS install. I\'ve been trying for two days to create a new yii app in the termin

5条回答
  •  被撕碎了的回忆
    2020-12-08 12:11

    (On macOS Mojave 10.14.6)

    A shortcut for the mentioned 'source' command above is just the period. So you can do the following:

    vi ~/.bash_profile
    

    Add in the lines

    export PATH="/usr/local/opt/php@7.3/bin:$PATH"
    export PATH="/usr/local/opt/php@7.3/sbin:$PATH"
    

    Hit colon W :w to write and colon Q to :q to quit VIM editor (bonus learning)

    And now you "apply" it by entering into the terminal: . ~/.bash_profile

    You can doublecheck the new PHP version now with php -v or which php

提交回复
热议问题