Skip to content

Instantly share code, notes, and snippets.

@wprater
Forked from daz/php-cgi.rb
Created May 25, 2012 15:49
Show Gist options
  • Save wprater/2788884 to your computer and use it in GitHub Desktop.
Save wprater/2788884 to your computer and use it in GitHub Desktop.
Homebrew Formula for PHP 5.4.3 as php-cgi (for nginx, etc.)
# Homebrew Formula for PHP 5.4.3 as php-cgi (for nginx, etc.)
require 'formula'
class PhpCgi <Formula
@url='http://www.php.net/get/php-5.4.3.tar.gz/from/a/mirror'
@version='5.2.17'
@homepage='http://php.net/'
@md5='c9dccc89cc89d39e84f6e6f0cf1c8a65'
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