Skip to content

Instantly share code, notes, and snippets.

@ambethia
Forked from eston/php-cgi.rb
Created June 18, 2011 13:10
Show Gist options
  • Save ambethia/1033082 to your computer and use it in GitHub Desktop.
Save ambethia/1033082 to your computer and use it in GitHub Desktop.
Homebrew Formula for PHP 5.2.14 as php-cgi (for nginx, etc.)
# Homebrew Formula for PHP 5.2.14 as php-cgi (for nginx, etc.)
require 'formula'
class PhpCgi <Formula
@url='http://www.php.net/get/php-5.2.14.tar.bz2/from/www.php.net/mirror'
@version='5.2.14'
@homepage='http://php.net/'
@md5='bfdfc0e62fe437020cc04078269d1414'
depends_on 'jpeg'
# depends_on 'freetype'
# depends_on 'libpng'
depends_on 'libmcrypt'
depends_on 'libiconv'
depends_on 'mysql'
def install
ENV.x11
configure_args = [
"--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking",
"--with-ldap=/usr",
"--with-kerberos=/usr",
"--disable-cli",
"--with-zlib-dir=/usr",
"--enable-exif",
"--enable-ftp",
"--enable-fastcgi",
"--enable-force-cgi-redirect",
"--enable-mbstring",
"--enable-mbregex",
"--enable-sockets",
"--with-iodbc=/usr",
"--with-curl=/usr",
"--with-config-file-path=#{prefix}/etc",
"--sysconfdir=/private/etc",
"--with-openssl=/usr",
"--with-xmlrpc",
"--with-xsl=/usr",
"--without-pear",
"--with-libxml-dir=/usr",
"--with-iconv=#{HOMEBREW_PREFIX}/Cellar/libiconv/#{versions_of("libiconv").first}",
"--with-gd",
"--with-jpeg-dir=#{HOMEBREW_PREFIX}",
# "--with-png-dir=#{HOMEBREW_PREFIX}/Cellar/libpng/#{versions_of("libpng").first}",
# "--with-freetype-dir=#{HOMEBREW_PREFIX}",
"--with-mcrypt=#{HOMEBREW_PREFIX}",
"--with-mysql-sock=/tmp/mysql",
"--with-mysql=#{HOMEBREW_PREFIX}",
"--with-mysqli=#{HOMEBREW_PREFIX}/bin/mysql_config",
"--with-pdo-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config"
]
system "./configure", *configure_args
system "make"
system "make install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment