Skip to content

Instantly share code, notes, and snippets.

@roderik
Last active January 30, 2020 06:07
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save roderik/3123962 to your computer and use it in GitHub Desktop.
Save roderik/3123962 to your computer and use it in GitHub Desktop.
Installing Apache with PHP in Travis-CI
language: php
php:
- 5.3
- 5.4
before_script:
- sudo apt-get install apache2
- sudo a2enmod actions
- sudo a2enmod rewrite
- echo "export PATH=/home/vagrant/.phpenv/bin:$PATH" | sudo tee -a /etc/apache2/envvars > /dev/null
- echo "$(curl -fsSL https://gist.github.com/roderik/16d751c979fdeb5a14e3/raw/gistfile1.txt)" | sudo tee /etc/apache2/conf.d/phpconfig > /dev/null
- echo "$(curl -fsSL https://gist.github.com/roderik/2eb301570ed4a1f4c33d/raw/gistfile1.txt)" | sed -e "s,PATH,`pwd`/web,g" | sudo tee /etc/apache2/sites-available/default > /dev/null
- sudo service apache2 restart
- mysql -u root -e "CREATE USER 'myproject'@'localhost' IDENTIFIED BY 'mypass'"
- mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'myproject'@'localhost' WITH GRANT OPTION;"
- bin/vendors install
- app/console doctrine:database:create
- app/console doctrine:schema:update --force
- app/console doctrine:fixtures:load
@klein0r
Copy link

klein0r commented Feb 11, 2014

Awesome! Thank you so much

@christopher-francisco
Copy link

Does this work? Travis won't allow sudo.

@iliyaZelenko
Copy link

2019: Apache + PHP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment