Skip to content

Instantly share code, notes, and snippets.

@BaylorRae
Forked from pateketrueke/install.sh
Created October 12, 2012 01:30
Show Gist options
  • Save BaylorRae/3876837 to your computer and use it in GitHub Desktop.
Save BaylorRae/3876837 to your computer and use it in GitHub Desktop.
Apache & PHP / Heroku pre-compile script
mkdir /app
# Compiling Apache
curl http://www.us.apache.org/dist/httpd/httpd-2.2.22.tar.gz | tar xzf -
cd httpd-2.2.22
./configure --prefix=/app/apache --with-z=/usr/local/zlib --enable-rewrite --enable-so --enable-deflate --enable-expires --enable-headers
make && make install
cd ..
# Apache libraries
mkdir -p /app/php/ext
cp /app/apache/lib/libapr-1.so /app/php/ext
cp /app/apache/lib/libaprutil-1.so /app/php/ext
cp /app/apache/lib/libapr-1.so.0 /app/php/ext
cp /app/apache/lib/libaprutil-1.so.0 /app/php/ext
# Compiling PHP
curl -L http://us.php.net/get/php-5.4.5.tar.gz/from/us.php.net/mirror | tar xzf -
cd php-5.4.5
./configure --prefix=/app/php --with-apxs2=/app/apache/bin/apxs --with-pgsql --with-pdo-pgsql --with-iconv --with-config-file-path=/app/php --with-openssl --with-readline --enable-mbstring --with-gd --with-jpeg-dir=/usr
make && make install
cd ..
# PHP Extensions
cp php-5.4.5/libs/libphp5.so /app/apache/modules/
# APC
curl http://pecl.php.net/get/APC/3.1.11 | tar xzf -
cd APC-3.1.11
/app/php/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/app/php/bin/php-config
make && make install
cd ..
mv /app/php/lib/php/extensions/no-debug-non-zts-20100525/apc.so /app/php/ext
rm -rf /app/php/lib/php/extensions
# Create packages
cd /app
echo '2.2.22' > apache/VERSION
tar -zcvf apache.tar.gz apache
echo '5.4.5' > php/VERSION
tar -zcvf php.tar.gz php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment