Skip to content

Instantly share code, notes, and snippets.

@bbrothers
Created January 14, 2014 20:55
Show Gist options
  • Save bbrothers/8425510 to your computer and use it in GitHub Desktop.
Save bbrothers/8425510 to your computer and use it in GitHub Desktop.
Vagrant php config extended from fideloper / Vaprobash
#!/usr/bin/env bash
# Add repo for latest PHP
sudo add-apt-repository -y ppa:ondrej/php5
# Update Again
sudo apt-get update
# Install PHP
sudo apt-get install -y php5-cli php5-mysql php5-pgsql php5-sqlite php5-curl php5-gd php5-mcrypt php5-xdebug php5-memcached
# xdebug Config
cat > /etc/php5/mods-available/xdebug.ini << EOF
xdebug.scream=1
xdebug.cli_color=1
xdebug.show_local_vars=1
EOF
### From Installing Apache
echo "--- Enabling mod-rewrite ---"
sudo a2enmod rewrite
echo "--- Setting document root ---"
sudo rm -rf /var/www
sudo ln -fs /vagrant/public /var/www
echo "--- Enable Error Reporting ---"
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php5/apache2/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php5/apache2/php.ini
sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
echo "--- Restarting Apache ---"
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment