Skip to content

Instantly share code, notes, and snippets.

@balibali
Created March 28, 2011 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balibali/890338 to your computer and use it in GitHub Desktop.
Save balibali/890338 to your computer and use it in GitHub Desktop.
HomebrewでPHPビルド(自分用適当バージョン) $ curl -o $(brew --repository)/Library/Formula/php.rb https://raw.github.com/gist/890338/php.rb
require 'formula'
class Php < Formula
url 'http://jp2.php.net/get/php-5.3.10.tar.bz2/from/this/mirror'
md5 '816259e5ca7d0a7e943e56a3bb32b17f'
homepage 'http://www.php.net/'
version '5.3.10'
depends_on 'jpeg'
depends_on 'mcrypt'
skip_clean :all
def install
args = [
"--prefix=#{prefix}",
"--mandir=#{man}",
"--with-config-file-path=#{prefix}/etc",
"--with-config-file-scan-dir=#{prefix}/etc/php.d",
"--with-apxs2",
"--enable-mbstring",
"--with-pdo-mysql=mysqlnd",
"--with-mysql=mysqlnd",
"--with-gd",
"--with-jpeg-dir",
"--with-png-dir=/usr/X11",
"--with-zlib",
"--with-openssl",
"--with-curl",
"--with-mcrypt",
"--with-libedit"
]
system "./configure", *args
inreplace "Makefile", "&& apxs -S", "&& sudo apxs -S"
system "make"
system "make install"
system "cp php.ini-development #{prefix}/etc/php.ini"
system "mkdir #{prefix}/etc/php.d"
f = File.open("#{prefix}/etc/php.d/my.ini", 'w')
f.puts 'date.timezone = Asia/Tokyo'
f.close
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment