Last active
September 29, 2018 19:35
-
-
Save s-belichenko/ce454d926ba10dd820ef7a8a19086532 to your computer and use it in GitHub Desktop.
Preparing Vagrant box via bootstrap script (scotch/box 2.5.0, purpose: apache2 + php 5.6)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################################### | |
# | |
# Bootstrap script v1.0.2 for Vagrant scotch/box 2.5.0 | |
# Purpose: Apache 2 + PHP 5.6 | |
# | |
######################################################### | |
echo "==================== Set up php vars ======================" | |
echo "==> post_max_size = 100M" | |
sudo replace "post_max_size = 8M" "post_max_size = 100M" -- /etc/php5/apache2/php.ini >/dev/null 2>&1 | |
echo "==> upload_max_filesize = 100M" | |
sudo replace "upload_max_filesize = 2M" "upload_max_filesize = 100M" -- /etc/php5/apache2/php.ini >/dev/null 2>&1 | |
echo "==> date.timezone = Europe/Moscow" | |
sudo replace ";date.timezone =" "date.timezone = Europe/Moscow" -- /etc/php5/apache2/php.ini >/dev/null 2>&1 | |
echo "======================== Xdebug ============================" | |
echo "==> Downloading xdebug-2.5.4" | |
if ! [ -L xdebug-2.5.4.tgz ]; then | |
sudo rm -rf xdebug-2.5.4.tgz | |
fi | |
wget http://xdebug.org/files/xdebug-2.5.4.tgz -nv >/dev/null 2>&1 | |
echo "==> Preparing files" | |
if ! [ -L xdebug-2.5.4 ]; then | |
sudo rm -rf xdebug-2.5.4 | |
fi | |
tar -xvzf xdebug-2.5.4.tgz >/dev/null 2>&1 | |
cd xdebug-2.5.4 | |
echo "==> Installing phpize" | |
# see more here: | |
# https://github.com/scotch-io/scotch-box/issues/275 | |
# https://askubuntu.com/questions/856996/cant-install-xdebug-depends-phpapi-20121212-ubuntu-14-04 | |
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list | |
sudo add-apt-repository --yes ppa:ondrej/php >/dev/null 2>&1 | |
sudo apt-get update >/dev/null 2>&1 | |
sudo apt-get install php5.6-dev -qq --force-yes >/dev/null 2>&1 | |
echo "==> Compiling Xdebug" | |
sudo phpize | |
sudo ./configure >/dev/null 2>&1 | |
sudo make >/dev/null 2>&1 | |
echo "==> Installing Xdebug" | |
sudo cp modules/xdebug.so /usr/lib/php5/20131226 >/dev/null 2>&1 | |
echo "zend_extension = /usr/lib/php5/20131226/xdebug.so" | sudo tee --append /etc/php5/apache2/php.ini 2>&1 >/dev/null | |
echo "======================= End of work =======================" | |
echo "==> Restarting web server" | |
sudo service apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment