Mac brew 安裝多版本php

Mac brew 安裝多版本php凉翻,這里我把詳細安裝信息留存?zhèn)溆梅蝗模畔⒗锩嬗泻芏喔韶洝?/p>

? ~brew install homebrew/php/php72

==> Installing php72 from homebrew/php

Error: Cannot install homebrew/php/php72 because conflicting formulae are installed.

php70: because different php versions install the same binaries.

Please `brew unlink php70` before continuing.

Unlinking removes a formula's symlinks from /usr/local. You can

link the formula again after the install finishes. You can --force this

install, but the build may fail or cause obscure side-effects in the

resulting software.

?? ~brew unlink php70? ? ? #解綁php70

Unlinking /usr/local/Cellar/php70/7.0.10_1... 17 symlinks removed

?? ~brew install homebrew/php/php72

Updating Homebrew...

==> Installing php72 from homebrew/php

==> Installing dependencies for homebrew/php/php72: libsodium

==> Installing homebrew/php/php72 dependency: libsodium

==> Downloading https://homebrew.bintray.com/bottles/libsodium-1.0.15.sierra.bottle.tar.gz

######################################################################## 100.0%

==> Pouring libsodium-1.0.15.sierra.bottle.tar.gz

??? /usr/local/Cellar/libsodium/1.0.15: 69 files, 959.6KB

==> Installing homebrew/php/php72

==> Downloading https://homebrew.bintray.com/bottles-php/php72-7.2.0_11.sierra.bottle.tar.gz

######################################################################## 100.0%

==> Pouring php72-7.2.0_11.sierra.bottle.tar.gz

==> Caveats

The php.ini file can be found in:

/usr/local/etc/php/7.2/php.ini

???? Extensions ????

If you are having issues with custom extension compiling, ensure that you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

PATH="/usr/local/bin:$PATH"

PHP72 Extensions will always be compiled against this PHP. Please install them using --without-homebrew-php to enable compiling against system PHP.

???? PHP CLI ????

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell's equivalent configuration file:

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

???? FPM ????

To launch php-fpm on startup:

mkdir -p ~/Library/LaunchAgents

cp /usr/local/opt/php72/homebrew.mxcl.php72.plist ~/Library/LaunchAgents/

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php72.plist

The control script is located at /usr/local/opt/php72/sbin/php72-fpm

OS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:

PATH="/usr/local/sbin:$PATH"

You may also need to edit the plist to use the correct "UserName".

Please note that the plist was called 'homebrew-php.josegonzalez.php72.plist' in old versions of this formula.

With the release of macOS Sierra the Apache module is now not built by default. If you want to build it on your system you have to install php with the --with-httpd option. See? brew options php72 for more details.

To have launchd start homebrew/php/php72 now and restart at login:

brew services start homebrew/php/php72

==> Summary

??? /usr/local/Cellar/php72/7.2.0_11: 350 files, 46.6MB

?? ~ export PATH="$(brew --prefix homebrew/php/php72)/bin:$PATH"

?? ~ php -v

PHP 7.2.0 (cli) (built: Dec? 3 2017 21:47:51) ( NTS )

Copyright (c) 1997-2017 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

(ps: 安裝完成)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末荸恕,一起剝皮案震驚了整個濱河市粪糙,隨后出現(xiàn)的幾起案子肠缔,更是在濱河造成了極大的恐慌糖埋,老刑警劉巖宣吱,帶你破解...
    沈念sama閱讀 218,941評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異瞳别,居然都是意外死亡征候,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,397評論 3 395
  • 文/潘曉璐 我一進店門祟敛,熙熙樓的掌柜王于貴愁眉苦臉地迎上來疤坝,“玉大人,你說我怎么就攤上這事馆铁∽渖罚” “怎么了?”我有些...
    開封第一講書人閱讀 165,345評論 0 356
  • 文/不壞的土叔 我叫張陵叼架,是天一觀的道長。 經(jīng)常有香客問我衣撬,道長乖订,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,851評論 1 295
  • 正文 為了忘掉前任具练,我火速辦了婚禮乍构,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘扛点。我一直安慰自己哥遮,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 67,868評論 6 392
  • 文/花漫 我一把揭開白布陵究。 她就那樣靜靜地躺著眠饮,像睡著了一般。 火紅的嫁衣襯著肌膚如雪铜邮。 梳的紋絲不亂的頭發(fā)上仪召,一...
    開封第一講書人閱讀 51,688評論 1 305
  • 那天寨蹋,我揣著相機與錄音,去河邊找鬼扔茅。 笑死已旧,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的召娜。 我是一名探鬼主播运褪,決...
    沈念sama閱讀 40,414評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼玖瘸!你這毒婦竟也來了秸讹?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,319評論 0 276
  • 序言:老撾萬榮一對情侶失蹤店读,失蹤者是張志新(化名)和其女友劉穎嗦枢,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體屯断,經(jīng)...
    沈念sama閱讀 45,775評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡文虏,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,945評論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了殖演。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片氧秘。...
    茶點故事閱讀 40,096評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖趴久,靈堂內(nèi)的尸體忽然破棺而出丸相,到底是詐尸還是另有隱情,我是刑警寧澤彼棍,帶...
    沈念sama閱讀 35,789評論 5 346
  • 正文 年R本政府宣布灭忠,位于F島的核電站,受9級特大地震影響座硕,放射性物質(zhì)發(fā)生泄漏弛作。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,437評論 3 331
  • 文/蒙蒙 一华匾、第九天 我趴在偏房一處隱蔽的房頂上張望映琳。 院中可真熱鬧,春花似錦蜘拉、人聲如沸萨西。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,993評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽谎脯。三九已至,卻和暖如春您机,著一層夾襖步出監(jiān)牢的瞬間穿肄,已是汗流浹背年局。 一陣腳步聲響...
    開封第一講書人閱讀 33,107評論 1 271
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留咸产,地道東北人矢否。 一個月前我還...
    沈念sama閱讀 48,308評論 3 372
  • 正文 我出身青樓,卻偏偏與公主長得像脑溢,于是被迫代替她去往敵國和親僵朗。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,037評論 2 355

推薦閱讀更多精彩內(nèi)容