Updating php version on mac

后端 未结 8 1685
旧巷少年郎
旧巷少年郎 2020-12-15 04:21

I want to update php version, currently I have 5.5.38 and I want 7.1

What I tried so far is using this command:

curl -s https://php-osx.liip.ch/insta         


        
8条回答
  •  孤街浪徒
    2020-12-15 05:02

    Install php

    brew install php@7.2
    

    Install the required PHP to your PATH

    echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
    echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
    source ~/.bash_profile
    

    Then make sure it's all working

    php -v
    php --version
    

    This command will show you where your ini file is loaded

    php --ini
    

提交回复
热议问题