Skip to content

Instantly share code, notes, and snippets.

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 rogeriopradoj/9172b8fd5bc3486ef4cc to your computer and use it in GitHub Desktop.
Save rogeriopradoj/9172b8fd5bc3486ef4cc to your computer and use it in GitHub Desktop.
# Worked under these envelopment
#
# AMI: amzn-ami-pv-2012.09.0.x86_64-ebs (ami-4e6cd34f)
# Zone: ap-northeast-1b
# Type: m1.large
#
# CentOS phpenv (https://github.com/CHH/phpenv) system wide installation script
# Execute as root user.
# Set group to use phpenv:
MY_GROUP=""
if [ "$MY_GROUP" = "" ] ; then
echo '!!! undefined variable MY_GROUP.'
echo '!!!'
echo '!!! ex.) MY_GROUP=staff phpenv-install-system-wide.sh'
echo '!!!'
exit 1
fi
# Update, upgrade and install development tools:
yum -y update
yum -y groupinstall "Development Tools"
yum -y install readline-devel byacc libxml2-devel gcc httpd-devel openssl-devel curl-devel libjpeg-devel libpng-devel libmcrypt-devel mysql-devel bzip2-devel libc-client-devel libtidy-devel make libxslt-devel git re2c libtool
# Install phpenv (actually rbenv):
pushd /tmp
git clone git://github.com/CHH/phpenv.git
cd phpenv/bin/
PHPENV_ROOT=/usr/local/phpenv ./phpenv-install.sh
popd
chgrp -R $MY_GROUP /usr/local/phpenv
chmod -R g+rwxXs /usr/local/phpenv
# Add phpenv to the path:
echo '# phpenv setup' > /etc/profile.d/phpenv.sh
echo 'export RBENV_ROOT=/usr/local/phpenv' >> /etc/profile.d/phpenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/phpenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/phpenv.sh
chmod +x /etc/profile.d/phpenv.sh
source /etc/profile.d/phpenv.sh
# Install php-build:
pushd /tmp
git clone git://github.com/CHH/php-build.git
cd php-build/
./install.sh
popd
# Install prefeered version of php-build:
php-build 5.4.11 /usr/local/phpenv/versions/5.4.11
phpenv global 5.4.11
# Rehash:
phpenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment