カテゴリー : Mac

[Mac] PHP5.4 を Homebrew でインストール

Mac に PHP5.4 を Homebrew でインストールしたのでメモ。

デフォルトでは、PHPのFormulaは無いので、homebrew-phpを使ってインストールします。

brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php

PHP5.4 のインストールオプションを確認します。

% brew options php54
--32-bit
	Build 32-bit only.
--homebrew-apxs
	Build against apxs in Homebrew prefix
--with-cgi
	Enable building of the CGI executable (implies --without-apache)
--with-debug
	Compile with debugging symbols
--with-fpm
	Enable building of the fpm SAPI executable (implies --without-apache)
--with-gmp
	Build with gmp support
--with-homebrew-openssl
	Include OpenSSL support via Homebrew
--with-imap
	Include IMAP extension
--with-intl
	Include internationalization support
--with-libmysql
	Include (old-style) libmysql support
--with-mssql
	Include MSSQL-DB support
--with-pgsql
	Include PostgreSQL support
--with-thread-safety
	Build with thread safety
--with-tidy
	Include Tidy support
--with-unixodbc
	Build with unixodbc support
--without-apache
	Build without shared Apache 2.0 Handler module
--without-bz2
	Build without bz2 support
--without-mysql
	Remove MySQL/MariaDB support
--without-pear
	Build without PEAR
% brew install php54 \
> --with-fpm \
> --with-homebrew-openssl \
> --with-intl \
> --with-pgsql
 
...
 
==> make install
==> /usr/local/Cellar/php54/5.4.16/bin/pear config-set php_ini /usr/local/etc/php/5.4/php.ini
==> Caveats
The php.ini file can be found in:
    /usr/local/etc/php/5.4/php.ini
 
✩✩✩✩ PEAR ✩✩✩✩
 
If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
    chmod -R ug+w /usr/local/Cellar/php54/5.4.16/lib/php
    pear config-set php_ini /usr/local/etc/php/5.4/php.ini
 
✩✩✩✩ Extensions ✩✩✩✩
 
If you are having issues with custom extension compiling, ensure that this php is
in your PATH:
    PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"
 
PHP54 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.
 
✩✩✩✩✩ INTL Support ✩✩✩✩✩
 
icu4c is broken as of mxcl/homebrew#03ed757c, so you will need to install intl as
a separate extension:
 
    brew install php54-intl
 
✩✩✩✩ FPM ✩✩✩✩
 
To launch php-fpm on startup:
    * If this is your first install:
        mkdir -p ~/Library/LaunchAgents
        cp /usr/local/Cellar/php54/5.4.16/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/
        launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
 
    * If this is an upgrade and you already have the homebrew-php.josegonzalez.php54.plist loaded:
        launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
        cp /usr/local/Cellar/php54/5.4.16/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/
        launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
 
The control script is located at /usr/local/Cellar/php54/5.4.16/sbin/php54-fpm
 
Mountain Lion comes 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 'org.php-fpm.plist' in old versions
of this formula.
 
To have launchd start php54 at login:
    ln -sfv /usr/local/opt/php54/*.plist ~/Library/LaunchAgents
Then to load php54 now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php54.plist
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
/usr/local/Cellar/php54/5.4.16: 490 files, 38M, built in 5.1 minutes

Pear の設定

% chmod -R ug+w /usr/local/Cellar/php54/5.4.16/lib/php
% pear config-set php_ini /usr/local/etc/php/5.4/php.ini
config-set succeeded

php54-intl のインストール

% brew install php54-intl

[Mac] Homebrew でインストールしておくべきもの

Mac に Homebrew でインストールしておくべきものをリストアップしてみました。

grep や ack よりも ag でしょ!

brew install the_silver_searcher

ターミナルのスクリーン分割なら tmux !!

brew install tmux

diff を色付きで表示させる colordiff

brew install colordiff

.zshrc に diff を colordiff にエイリアスすると更に便利

alias diff='colordiff'

cmake

brew install cmake
brew install hub
brew install pstree
brew install tree
brew install wget

参考情報

にひりずむ::しんぷる – homebrew で最低限これだけはいれておけってやつ

[Mac] Node.js インストール中にエラー Build failed: -> task failed (err #2): {task: uv uv.h -> uv.a}

Xcode で Command Line Tools をインストールして、かつ、osx-gcc-installerをインストールしたら、Node.js がインストールできなくなった問題を解決した話をご紹介します。

続きを読む

[Mac] OpenSSL を Homebrew でインストール

Mac のデフォルトの OpenSSL を使わずに、Homebrew でインストールした OpenSSL を使うためのインストール手順をメモ。

デフォルトの OpenSSL を確認

% which openssl
/usr/bin/openssl
% openssl version

OpenSSL を Homebrew でインストール

% brew install openssl
% brew link openssl --force
% which openssl 
/usr/local/bin/openssl
% openssl version
OpenSSL 1.0.1e 11 Feb 2013

以上です。

[Mac] 開発環境のセットアップ手順メモ

Mac に開発環境をセットアップしたので、やったことと手順をメモ。

GCC をインストール
kennethreitz/osx-gcc-installer

[Mac] Homebrew をインストール(ついでにGitもインストール)

[Mac] zsh のインストール手順と設定メモ

[SSH] 秘密鍵を Dropbox にバックアップしつつ、シンボリックリンクを張って使えるようにする設定

$ ln -s ~/Dropbox/dotfiles/_gitconfig ~/.gitconfig

[Mac] Finder の環境設定メモ [2013年版]

Mac の Finder の環境設定をメモ。

finde_config1

finder-config2

finder-config3

以上です。

[MacOS] システム環境設定の設定メモ [2013年版]

Mac の「システム環境設定」の個人用設定メモをご紹介します。

system-config

続きを読む

[macOS] ショートカットキーでウィンドウサイズや配置を変更できるアプリ「Divvy」

macOS でショートカットキーを使ってウィンドウサイズや配置を変更できるアプリ Divvy が便利なのでご紹介します。

続きを読む

[Mac] 不要ファイルを探して削除できるアプリ「Magican」

Mac で、不要ファイルを探して削除してくれる「Magican」というアプリを使って、ディスク枯渇問題をしのぎました。

Magican – 無料のMacシステム最適化ユーティリティ

[Mac] nkf を Homebrew でインストール

Mac に Homebrew で nkf をインストールしました。

% brew install nkf                     
==> Downloading http://dl.sourceforge.jp/nkf/53171/nkf-2.1.2.tar.gz
######################################################################## 100.0%
==> Patching
patching file Makefile
==> make
==> make install
/usr/local/Cellar/nkf/2.1.2: 4 files, 252K, built in 2 seconds

楽ちん