In this tutorial we will show you how to install a Lamp server with PHP 7.0 and 5.6. You will use PHP 7.0 for cli tools and 5.6 for apache.

Install PHP 7.0 and 5.6

Install Apache

Install MySQL

Install other Dependencies

Install PhpMyAdmin

Make sure you select the option “apache” pressing the spacebar key to select it.

Then whenever you need to create a new project, you can create an individual Virtual Host for each one. For this you need to follow this steps:

  1. Activate the mod_rewrite and mod_headers modules with:
  2. Create a new host file
  3. Put the following content with the correct parameters according to you project
  4. Save the file and then copy it to sites-enabled directory
  5. Create a host entry in your hosts file
  6. If this is a local development server, you can edit the default user/group for apache2 to prevent 403 errors
  7. Change the following lines:

  8. Restart apache server
  9. And then create a php file to test your project
  10. Test it on and it should be working!

Htaccess support:

If you want to enable the htaccess support for the whole server, you have to follow these steps:

NOTE: If you forgot to select “apache” in the phpmyadmin installation, you have to follow these steps:

Leave a comment