markdown 通过Brew在OSX上设置PHP和Composer

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 通过Brew在OSX上设置PHP和Composer相关的知识,希望对你有一定的参考价值。

First install Brew on your MAC

- Setup Brew: `ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
- `brew update`
- `brew tap homebrew/dupes`
- `brew tap homebrew/php`
- Install PHP 7.0.+ `brew install php70`
- Install `mcrypt`: `brew install mcrypt php70-mcrypt`
- Finally, install composer: `brew install composer`

Now if you run `$ php -v`, you will get `PHP 5.5` or something.
This is the default PHP version that is shipped with OSX and cannot be removed.
You just need to edit your path to ensure that `PHP 7.0` is picked up.

`export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"`

To debug any issue with any package, you can run `brew info php70` etc.

Also, if you are getting seemingly unrelated errors, make sure to update bash/zsh: `brew upgrade bash` and `brew upgrade zsh`.

If everything is setup correctly, running `$ php -v` should give you 7.0.+.

以上是关于markdown 通过Brew在OSX上设置PHP和Composer的主要内容,如果未能解决你的问题,请参考以下文章

mac OSX 上 brew install hive

OSX 10.10 Yosemite 本地开发环境崩溃 - PHP mcrypt 问题

在 Mac OSX 上启用 PHP pdo_odbc 扩展

如何使用 xampp 在 OSX 上正确设置 php_gmp

如何在 OSX 上为 XAMPP 安装 PHP MongoDB 驱动程序?

OSX Brew Python“找不到满足 pyopencv 要求的版本”