Skip to content

Instantly share code, notes, and snippets.

@jehadassaf
Last active February 26, 2018 16:54
Show Gist options
  • Save jehadassaf/940251c5be265fcd6c82 to your computer and use it in GitHub Desktop.
Save jehadassaf/940251c5be265fcd6c82 to your computer and use it in GitHub Desktop.
Add extra stuff to Homestead
#!/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.
echo "Updating repositories..."
apt-get -qq update
echo "Disabling XDebug..."
phpdismod xdebug
service php7.0-fpm restart
echo "Installing extra PHP extensions..."
apt-get install -y --force-yes unzip php7.0-ldap php7.0-mcrypt
echo "PHP OCI8 Driver..."
mkdir /opt/oracle && cd /opt/oracle
echo "Downloading Oracle Instant Client binaries - this may take a while..."
wget --quiet https://dl.dropboxusercontent.com/u/582415/linux/instantclient-basic-linux.x64-12.2.0.1.0.zip
wget --quiet https://dl.dropboxusercontent.com/u/582415/linux/instantclient-sdk-linux.x64-12.2.0.1.0.zip
unzip \*.zip
cd instantclient_12_1
ln -s libnnz12.so libnnz.so
ln -s libclntshcore.so.12.1 libclntshcore.so
ln -s libclntsh.so.12.1 libclntsh.so
ln -s libocci.so.12.1 libocci.so
export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_1:$LD_LIBRARY_PATH
echo "Re-install PEAR..."
apt-get -y --force-yes remove php-pear --purge
apt-get -y --force-yes install php-pear
pear config-set php_dir /usr/share/php/PEAR
echo 'include_path=".:/usr/share/php:/usr/share/php/PEAR"' >> /etc/php/7.0/fpm/php.ini
echo 'include_path=".:/usr/share/php:/usr/share/php/PEAR"' >> /etc/php/7.0/cli/php.ini
echo "Restarting services..."
service php7.0-fpm restart
service nginx restart;
printf "instantclient,/opt/oracle/instantclient_12_1" | pecl install oci8
echo 'extension=oci8.so' >> /etc/php/7.0/fpm/php.ini
echo 'extension=oci8.so' >> /etc/php/7.0/cli/php.ini
echo "Restarting services..."
service php7.0-fpm restart
service nginx restart;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment