Skip to content

Instantly share code, notes, and snippets.

@lotterfriends
Last active November 6, 2016 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lotterfriends/e2fef322a220e8c6b92abc09ca6271bc to your computer and use it in GitHub Desktop.
Save lotterfriends/e2fef322a220e8c6b92abc09ca6271bc to your computer and use it in GitHub Desktop.
install php5, php7, mysql, phpmyadmin with linux (ubunut 16 based systems and up)
# apache
sudo apt-get install apache2 apache2-doc
# header module
sudo a2enmod headers
# rewrite module
sudo a2enmod rewrite
# php
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
# add alias switch
echo "alias set_php_5='sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart'" >> ~/.bash_aliases
echo "alias set_php_7='sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart'" >> ~/.bash_aliases
# link project folder
cd /var/www && sudo mv html _html && sudo ln -s ~/projekte html
# MySQL
sudo apt-get install mysql-server
sudo apt-get install php-mysql
# phpMyAdmin
sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment