Installing Apache2, MySQL Server, PHP5, and phpMyAdmin on Ubuntu 15.10

Linux Tips
Installing Apache2, MySQL Server, PHP5, and phpMyAdmin on Ubuntu 15.10

Introduction

Hey there!
Here are some cool and simple tips to install a full LAMP stack on Ubuntu 15.10: Apache2, MySQL Server, PHP5, and phpMyAdmin—without using XAMPP!

Let’s get started!

Installation

Open a terminal and run the following command:

sudo apt-get install apache2 mysql-server php5 phpmyadmin

The installer will prompt for permissions, user passwords, and configuration steps. Follow the instructions provided.

Accessing the Stack

Once everything is installed, open your browser and test the following URLs:

  • http://localhost
  • http://localhost/phpmyadmin

If everything went well, both should load successfully! 🎉

Bonus Tip: Folder Permissions

By default, your project files will be located in /var/www, which requires superuser privileges. To avoid constantly running editors or file managers as root, you can give yourself access with this command:

sudo chmod -R 777 /var/www

Note: This is fine for local development, but not recommended for production environments.

Enable PHP File Viewing in Apache

Sometimes Apache needs to be configured to prioritize .php files. Run this command to edit the configuration:

sudo nano /etc/apache2/mods-enabled/dir.conf

You’ll see something like:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

Move index.php to the front so it looks like this:

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

Save and exit by pressing CTRL+X, confirm with Y, then press ENTER.


That’s it! Everything should be working fine now.

See you next time! 👋


Comments

Search

Cargando buscador...