MAC系統如何快速安裝php

來源:互聯網
上載者:User

先安裝Homebrew

擷取 Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

開啟終端視窗, 粘貼以上指令碼。

指令碼會解釋它的作用,然後在您的確認下執行安裝。進階安裝選項請看 這裡(需要10.5)。



What Does Homebrew Do?

又提示缺少套件啦?別擔心,Homebrew 隨時守候。

$ brew install wget

Homebrew 會將套件安裝到獨立目錄,並將檔案軟連結至 /usr/local 。

$ cd /usr/local
$ find Cellar
Cellar/wget/1.16.1
Cellar/wget/1.16.1/bin/wget
Cellar/wget/1.16.1/share/man/man1/wget.1

$ ls -l bin
bin/wget -> ../Cellar/wget/1.16.1/bin/wget

Homebrew 的所有檔案均會被安裝到預定義目錄下,所以您無需擔心 Homebrew 的安裝位置。

輕鬆建立您的 Homebrew 程式。

$ brew create https://foo.com/bar-1.0.tgz
Created /usr/local/Library/Formula/bar.rb

以 git、 ruby 為其筋骨,所以藉助您的相關知識,自由修改,並且可以簡單撤回您的調改或者合并上遊更新。

$ brew edit wget # 使用 $EDITOR 編輯!

Homebrew 的程式都是簡單的 Ruby 指令碼:

class Wget < Formula
  homepage "https://www.gnu.org/software/wget/"
  url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"
  sha256 "52126be8cf1bddd7536886e74c053ad7d0ed2aa89b4b630f76785bac21695fcd"

  def install
    system "./configure", "--prefix=#{prefix}"
    system "make", "install"
  end
end

Homebrew 使 OS X 更完美。使用 gem 來安裝 gems、用 brew 來搞定那些依賴包。


正式安裝php

# 添加源
brew tap josegonzalez/homebrew-php

# 一鍵安裝php各個版本
brew install php54 php54-mcrypt
brew install php55 php55-xdebug
brew install php56

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.