Wednesday, May 24, 2017

How to install PHP7.x, MySQL5.7 on Ubuntu 16.x

Open the terminal
>sudo apt-get update
>sudo apt-get install php-mbstring php7.0-mbstring php-gettext apache2 mysql-server-5.7 mysql-client php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0
This will download all the required dependencies and will ask you to
  • Key in password for root for mysql
  • decide which webserver (select apache2)
  • Setup phpmyadmin with db-config – This time say ‘Yes’ and then enter the phpmyadmin db password you want to keep
Once this done
  • sudo mysql_secure_installation (answer the questions appropriately)
  • sudo phpenmod mycrypt
  • sudo phpenmod mbstring
  • sudo systemctl restart mysql
  • sudo systemctl restart apache2
  • sudo a2enmod rewrite
  • sudo systemctl restart apache2
Enable rewrite module
>sudo vim /etc/apache2/sites-enabled/000-default.conf
Inside that file, you will find the block on line 1. Inside of that block, add the following block:

< Directory /var/www/html >
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
< / Directory >
>sudo service apache2 restart

You are done. Open up a browser and access – http:// < server ip address >

No comments:

Post a Comment

Design thinking at work (Book summary)

Key things to keep in mind The essence of design thinking, in many ways, involves identifying problems by seeing things that other peo...