Installing PHP using Homebrew on MAC

前端 未结 2 1005
轻奢々
轻奢々 2021-02-02 14:20

I am trying to install PHP on my MAC machine using Homebrew. I am using the following command: brew install php

However, I am getting the following errors:

2条回答
  •  既然无缘
    2021-02-02 14:37

    After installing PHP with brew,

    brew install php@7.3
    

    or any version you need(could be: php@7.2)

    run this command to ensure you have PHP installed: brew list | grep php then you need to manually add an alias as follows:

    alias php='/usr/local/Cellar/php@7.3/7.3.13/bin/php'
    

    Then, for the change to take effect you need to refresh your terminal. You can use: source ~/.bash_profile command, or close and open terminal.

提交回复
热议问题