Basic LAMP development environment on Xubuntu 16.04

  • Posted on: 18 June 2018
  • By: charm
Geany text editor showing a PHP script from our POS system

One of the jobs I've wanted to work on for awhile is to convert the Point-Of-Sale (POS) we use at work over to PHP7 and to make it available to the open source community.

Despite the fact that I've written a few BBS door games (using a Synchronet developed language), a text adventure (using AGT), a racing game for the Commodore 64 (I don't even remember what language I used, but it was probably basic), some RPG tools for gamers (using Tcl/Tk), and most recently an Asteroids-like game (using Game Maker Studio 1.4), I don't consider myself a programmer.

Other than an evening course I took on C programming back in 1995, a bit of Turing in 1999, and a handful of BASIC courses (which I already knew from working on the c64) I took in high school, I  have no formal computer programming training.

I am curious about programming and because we decided to use PHP and MySQL for our point of sale I can find online how to change things up. These instructions are for setting up a very basic LAMP stack development environment. I'm using Xubuntu 16.04 as my development environment, but it should work as well on Kubuntu or Ubuntu 16.04. It's worth noting that *buntu 18.04 ships with a different version of MySQL which requires some extra set-up not covered here.

The instructions below are for my non-Linux using friends looking to use Linux for developing a basic PHP and MySQL application: Here's what I've been installing, starting with PHP:

sudo apt-get install php-cli php-common php-curl php php-dev

And now git:

sudo apt install git
git config --global color.branch auto
git config --global color.diff auto
git config --global color.status auto

Memcache should help with caching:

sudo apt install memcached
sudo apt install php-memcache

LAMP wouldn't be useful without apache:

sudo apt-get install apache2 sudo a2enmod rewrite sudo apt install libapache2-mod-php

And of course MySQL:

sudo apt install mysql-server
sudo apt install php-mysql

Imagemagick is frequently used by LAMP stacks to do operations on images, so it's handy to have installed too:

sudo apt install imagemagick php-imagick

On the editor side of things I like geany:

sudo apt install geany geany-plugin-addons geany-plugin-codenav geany-plugin-commander geany-plugin-ctags geany-plugin-debugger geany-plugin-devhelp geany-plugin-doc geany-plugin-gendoc geany-plugin-lineoperations geany-plugin-markdown geany-plugin-overview geany-plugin-pairtaghighlighter geany-plugin-projectorganizer geany-plugin-treebrowser geany-plugin-webhelper geany-plugins

For a more expert installation including a lot more tools see Ralph Meier's article on Ubuntu php development. Watching Garrett Mills video on setting up a PHP development environment also reminded me to install composer:

sudo apt install composer

I was also pulling data from an SSH server and I'm pretty lazy with my ssh commands, preferring to use filezilla to transfer files:

sudo apt install filezilla

For the moment this is it, I just wanted to do a quick post about some of the tools I use. Often I'll do this in a Virtualbox using Ubuntu Server and use the visual tools on Xubuntu to connect to the virtual server, but I was in a rush this morning and decided just to rush this post out.