One of the earlier posts showed how to setup XAMPP on Linux Mint/Ubuntu system.
This is great for setting a test web setup but instead of relying on a single XAMPP package, each of the individual components can also be installed separately namely Apache, MySQL and PHP.
This is especially applicable when building an Ubuntu server as a LAMP (Linux, Apache, MySQL, PHP) setup to host websites or web apps.
To setup a LAMP stack on Ubuntu / Linux Mint system :
1. First make sure to get the latest updates for the system by opening Terminal and typing :
2. Next, it is time to setup Apache web server :
3. For setting up MySQL database services :
Follow the on-screen instructions and enter a root password during MySQL installation. Then to enable PHP support for MySQL:
4. Finally for setting up PHP :
At this point, the LAMP server is setup. Simply reload the Apache web server by typing :
Enter http://localhost in browser, the following page should come up indicating web server is running :
Now, to validate that PHP is setup correctly and LAMP server is working as expected, go to the default web server directory (/var/www) and create a file named info.php
In it, enter the following PHP code and save the file :
Now, access this by typing http://localhost/info.php
This will load the PHP info page displaying the configuration settings and also basically validating that PHP is now being served correctly by the Apache webserver.
All done.
Happy installing!