Skip to content

Instantly share code, notes, and snippets.

@larryli
Last active April 20, 2016 13:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larryli/bee9e699f995376b56cb to your computer and use it in GitHub Desktop.
Save larryli/bee9e699f995376b56cb to your computer and use it in GitHub Desktop.
laravel homestead install phalcon and remove postgresql/memcached/beanstalkd/redis
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
# install phalcon
phalcon_so="`php-config --extension-dir`/phalcon.so"
if [ ! -f $phalcon_so ]; then
# apt-get install -y php5-dev php5-mysql gcc libpcre3-dev
apt-get install -y git php5-dev gcc libpcre3-dev
cd ~/
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd ~/cphalcon/build
./install
rm -rf ~/cphalcon
fi
phalcon_ini="/etc/php5/mods-available/phalcon.ini"
if [ ! -f $phalcon_ini ]; then
echo "extension=phalcon.so" | tee $phalcon_ini
if [ -d "/etc/php5/cli/" ]; then
ln -sf ../../mods-available/phalcon.ini /etc/php5/cli/conf.d/20-phalcon.ini
fi
if [ -d "/etc/php5/fpm/" ]; then
ln -sf ../../mods-available/phalcon.ini /etc/php5/fpm/conf.d/20-phalcon.ini
service php5-fpm restart
fi
fi
# remove postgresql
if [ -f "/etc/init.d/postgresql" ]; then
apt-get purge -y postgresql-9.4 postgresql-client-common postgresql-contrib-9.4 postgresql-client-9.4 postgresql-common
apt-get autoremove -y -qq
fi
# remove memcached
if [ -f "/etc/init.d/memcached" ]; then
apt-get purge -y memcached
apt-get autoremove -y -qq
fi
# remove beanstalkd
if [ -f "/etc/init.d/beanstalkd" ]; then
apt-get purge -y beanstalkd
apt-get autoremove -y -qq
fi
# # remove redis
if [ -f "/etc/init/redis-server.conf" ]; then
apt-get purge -y redis-server
apt-get autoremove -y -qq
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment