How to install PHP MySQL on Xubuntu 16.04

How to install PHP MySQL on Xubuntu 16.04

You might want to install php and mysql, if you are going to develop some web application using php. This article will show you how to install php and mysql on xubuntu 16.04.

Unlike the previous version, on xubuntu 16.04 you no longer have php 5 support, instead you are getting php 7, so basically this tutorial is about installing php 7 and mysql on xubuntu 16.04

Step by step installing php 7 on xubuntu 16.04
  • install apache web server, skip this if you already have apache installed on your system 
  • sudo apt-get install apache2
  • install php 7 package
  • sudo apt-get install php7.0
  • install library of php for apache web server
  • sudo apt-get install libapache2-mod-php7.0
  • test if the php and apache can work together, create new file inside /var/www/html/ called info.php and copy paste this code:
  • <?php
    phpinfo();
    ?>
  • open url http://localhost/info.php on a web browser, it should display php information page, this mean the apache web server and php is working.
  • http://localhost/info.php


Step by step installing mysql web server on xubuntu 16.04
  • install mysql server and mysql client
  • sudo apt-get install mysql-server mysql-client
  • install mysql module for php 7.0
  • sudo apt-get install php7.0-mysql

Share this

Previous
Next Post »