How do I upgrade PHP in Mac OS X?

前端 未结 13 809
暖寄归人
暖寄归人 2020-12-12 13:34

I feel this is an awfully obtuse question to ask, but strangely, this problem is poorly documented.

I would like to upgrade PHP, but there are several problems:

13条回答
  •  青春惊慌失措
    2020-12-12 14:03

    I use this: https://github.com/Homebrew/homebrew-php

    The command is:

    $ xcode-select --install
    
    $ brew tap homebrew/dupes
    $ brew tap homebrew/versions
    $ brew tap homebrew/homebrew-php
    
    $ brew options php56
    $ brew install php56
    

    Then config in your .bash_profile or .bashrc

    # Homebrew PHP CLI
    export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"
    

提交回复
热议问题