Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
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