LAMP Development Environment for Linux

Best Practices For PHP Development Using Linux

View project on GitHub

Introduction

This article will provide an environment to develop websites using LAMP (Linux, Apache, MySQL and PHP). The Linux distribution used here is Ubuntu (64 bit), but you can apply the instructions that will follow to your beloved Linux distro.

By the time of writing, Ubuntu is on version 14 and the version of all applications and servers within this article will follow the latest version we can get from Ubuntu’s software repositories.

If you plan to install and work with Ubuntu’s distribution, please refer to their website, http://www.ubuntu.com/, to download the “Desktop” version, in the other hand, if you plan to create a Vagrant [1] like Virtual Machine, please consider Ubuntu “Server”. This article will not cover the installation of Ubuntu, it is already very well documented, just follow the links within their download page. If you have any concern or get stuck with any issue, count on their community help, http://askubuntu.com/, or read their guide to get familiar with this Operational System (https://help.ubuntu.com/14.04/index.html) and, of course, searching the internet.

The article is split with LAMP installation and configuration - including the best Apache configuration we can get to speed up websites first configuration on Linux. Then we will go after Chrome browser, XDebug and a self signed SSL Certificate to develop and test under HTTPS. The scope is to cover “the development environment” and ensure that every application cited will be ready to be used - so opinions regarding IDEs, how to use Chrome for development, or how to use XDebug, or if you should use SASS or LESS or how you will test your software is all out of scope. A Linux basic knowledge is assumed to fully understand this article.

Searching for similar content in the internet will give you a plenty of links, but the main reason of this article is to have the best practices for PHP development for web in one place - that said, you are invited to send your opinions, suggestions and collaborate with a better article when it is a time for an update.

Going LAMP

As explained by the Introduction, Linux (the “L” of our LAMP) will be Ubuntu’s distribution.

Let’s start considering that you are already reading this article from your Ubuntu. It is always a good practice to maintain all software repositories[2] up to date before installing them, therefore execute the command below to have their latest version:

$ sudo apt-get update

Apache

Apache (server-side) will be our web server, where PHP code will be executed and respond to requests coming from the client side, usually the browser installed on the end-user device or personal computer.

To install apache, execute:

$ sudo apt-get install apache2

Your webserver is going to be installed after you accept the question that will follow. When apt-get finishes, you can browse http://localhost/ and see the “Apache2 Ubuntu Default Page” - see Appendix A.

It will be nice if we tell Apache from where it should serve requests, to do so you need to edit /etc/apache2/apache2.conf with your desired editor and add the line “ServerName localhost”:

$ sudo gedit etc/apache2/apache2.conf
# Now add the line below right after the "Global configuration"
# section comments:
ServerName localhost

Ok, now that you have Apache installed you will notice that you must always use the sudo command to start creating websites within /var/www. To avoid doing “sudos” all the time, the author of this article prefers to be part of the www-data group, that Apache uses to serve the requests, because it is implicit that we are going to be the only user accessing /var/www. So we can work on code directly under /var/www, but we can also have projects that your user owns at any directory, for instance under our HOME directory, symlinked to /var/www.

So, lets add your user to the www-data group:

$ sudo gpasswd -a "$USER" www-data

Also, lets change the ownership of any previously created files and directories:

$ sudo chown -R "$USER":www-data var/www
$ find /var/www -type f -exec chmod 0660 {} \; 
$ sudo find /var/www -type d -exec chmod 2770 {} \;

After executing the commands above, /var/www will be owned by your user, under the group www-data, where Apache runs. The other commands are related to security: the second one makes just you and www-data group able to read and write all the files under /var/www and the third command [3] will ensure that only the owner of files within /var/www can unlink or rename those files.

Apache mod_vhost_alias and dnsmasq

When using Apache, developers usually work with Apache’s vhosts and write specific domains on /etc/hosts file, so they can have a development environment for a project.

Now it is time to think about when you have more than one web project to develop, assuming that you will have symlinks or entire websites under /var/www - it will be required that you have a quick site setup, it could be for starting a new project, or working on new features or even when you are responsible for fixing bugs or helping with savvy issues on websites already in production.

The Apache’s vhosts_alias module and a local DNS is up to this task. Working with it gives the possibility to any directory we create to be already a vhost - yes, we can have a dynamic vhosts creation. The local DNS, considering dnsmasq[4] application, will provide a way to have a common top-level domain for development, like “dev” - for instance, we could access /var/www/project1.dev browsing for http://project1.dev/. The consequences of this configuration will be:

  1. .htaccess needs to have the “RewriteBase /” directive in the top level directory;
  2. All logs will go to the same file, since we will use just one vhost file to catch all requests.

Lets enable mod_rewrite for RewriteBase directive:

$ sudo a2enmod rewrite

Now lets enable the mod_vhost_alias:

$ sudo a2enmod vhost_alias

From here you can configure a vhost to catch all requests, adapting it to your setup needs. I suggest just editing the /etc/apache2/sites-enabled/000-default.conf:

$ sudo gedit /etc/apache2/sites-enabled/000-default.conf 
# Feel free to copy and paste the configuration below <VirtualHost *:80> ServerName vhosts.dev VirtualDocumentRoot "/var/www/%0" ServerAlias *.dev UseCanonicalName Off # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn LogLevel warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory "/var/www/*"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>

Please, refer to the documentation webpage of Apache mod_vhost_alias (on the References) to learn more about this “%0” on the VirtualDocumentRoot directive.

To start using this awesome feature, just restart Apache:

$ sudo service apache2 restart

If you go to /var/www and try to test this feature, you will get issues Linux’s /etc/hosts doesn’t understand a wildcard character like “*”. Lets install and configure dnsmasq to make it worth:

$ sudo apt-get install dnsmasq

Next, edit dnsmasq.conf file and add the following lines to the bottom:

$ sudo gedit /etc/dnsmasq.conf

# Lines to be added on /etc/dnsmasq.conf:
listen-address=127.0.0.1
address=/.dev/127.0.0.1

Restart dnsmasq:

$ sudo service dnsmasq restart

Now you can check that any domain finishing with “dev” will be served by your localhost:

$ host test.dev

The expected result of the command above is: “test.dev has address 127.0.0.1”.

If you create a directory /var/www/test.dev, then create a index.html file and write a “Hello World” there, you will see it working browsing http://test.dev/ - if you just installed Apache, you can rename that “html” directory to “test.dev”.

Lets say you need a URL like test2.local as an exception, you can edit the first line of /etc/hosts, e.g.:

127.0.0.1        localhost test2.local

Then create the directory /var/www/test2.local and copy your project files inside. I am using this specific “.local” as an example of top-level domain because Ubuntu already uses it[5] - if try it as your top-level domain for dynamic vhosts, it will not work. You can also use your own IP to be a symlink to a directory, if you want someone browsing your local project using your IP.

SSL Certificate (HTTPS)

You Apache server answers requests coming from port 80 already, this is the HTTP protocol, but when you need to develop a website using HTTPS, that uses port 443, you are going to need to perform the steps below.

SSL support actually comes standard in the Ubuntu 14.04 Apache package. We simply need to enable it to take advantage of SSL on our system.

$ sudo a2enmod ssl

Now it is time to create a self-signed certificate under /etc/apache2/ssl:0/p>

sudo mkdir /etc/apache2/ssl

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

You will need to answer some basic questions for you self-signed certificate. It can be something like this:

Country Name (2 letter code) [AU]: BR
State or Province Name (full name) [Some-State]: Sao Paulo
Locality Name (eg, city) []: Campinas
Organization Name (eg, company) [Internet Widgits Pty Ltd]: Your Company
Organizational Unit Name (eg, section) []: Your Department/Section
Common Name (e.g. server FQDN or YOUR name) []: your_domain.com
Email Address []: your_email@domain.tld

We are going to use /etc/apache2/sites-available/default-ssl.conf, since it is the sibling of 000-default.conf that we used to all requests from “dev” top-level domain.

<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    DocumentRoot /var/www/
    VirtualDocumentRoot /var/www/%0

    LogLevel warn
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLEngine on
    SSLCertificateFile	/etc/apache2/ssl/apache.crt
    SSLCertificateKeyFile /etc/apache2/ssl/apache.key

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
      SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
      SSLOptions +StdEnvVars
    </Directory>

    BrowserMatch "MSIE [2-6]" \
      nokeepalive ssl-unclean-shutdown \
      downgrade-1.0 force-response-1.0
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
  </VirtualHost>
</IfModule>

Activate this brand new virtual host for “dev” top-level domains requesting HTTPS protocol:

$ sudo a2ensite default-ssl.conf

You'll have to restart the web server for recognizing all changes:

$ sudo service apache2 restart

It is time to test your configuration browsing https://test.dev/ - accept the self-signed certificate and that is it!

PHP

To have PHP fully working on your environment, you need it integrated with Apache and the operational system’s recognition of this language, so you will need to install the packages below:

$ sudo apt-get install php5 libapache2-mod-php5

The command above will prepare Apache to run PHP scripts within a web page and also will restart Apache for you.

Now it is time to play, lets create a dir /var/www/phpinfo.dev and a index.php file with a call to phpinfo()[6].

$ mkdir /var/www/phpinfo.dev
$ echo '<?php phpinfo() ?>' > /var/www/phpinfo.dev/index.php

When browsing http://phpinfo.dev you will see the phpinfo function output. You just have the latest PHP version from Ubuntu’s software repository working with your Apache server.

MySQL

To have MySQL database working and also ensure the integration with PHP:

$ sudo apt-get install php5-mysql mysql-server

You will be asked to set your MySQL’s root user password. After all the installation, try to connect to your database:

$ mysql -u root -p

Type your root password and perform some MySQL commands, like “show databases;” and then “exit.

Feel free to use a graphical user interface application to work with MySQL, like MySQL Workbench [7], or phpMyAdmin [8]. The author prefers MySQL Workbench.

$ sudo apt-get install mysql-workbench

Developing with quality

When developing software, quality is non negotiable - so you must use tools to help building your software in the best way. The next topics will prepare your environment to have a minimum setup for this goal.

Chrome Browser

Chrome is a top-notch browser for development, it has good solutions ranging from styling web pages to javascript debugging.

As per http://www.ubuntuupdates.org/ppa/google_chrome:

$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
$ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
$ sudo apt-get update
$ sudo apt-get install google-chrome-stable

After executing those commands you will have Chrome Browser ready in you Ubuntu software repositories and it will update when a new version of Chrome is released.

Explore https://developer.chrome.com/ and catch up with Chrome's tools for developers.

Xdebug

Xdebug is an extension to PHP, it will add functions for debugging and you can also integrate it to your IDE, so you can breakpoint your code where the PHP execution should stop and you can see the call stack and variables values. Let’s install and configure it without further ado:

$ sudo apt-get install php5-xdebug
$ grep -R "xdebug.so" /usr/lib/php5/
# Use the path indicated on the result of the last command on php.ini
# E.g.: "Binary file /usr/lib/php5/20121212/xdebug.so matches" will give the path
# for zend_extension parameter

$ sudo gedit /etc/php5/apache2/php.ini

# Copy and paste the configuration below at the end of the file
# Xdebug configuration
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable = 1
# Close the editor

$ sudo service apache2 restart

For Ubuntu 14 you just need to ensure that xdebug.remote_enable setting is “on”, so your IDE will listen to your localhost on port 9000 and your breakpoints will work.

Browse http://phpinfo.dev again (that index.php file we’ve created on the PHP topic) and search for “xdebug”, notice that you have a new 20-xdebug.ini parsed as extra configuration for Apache and also a new entire information section called “xdebug”, showing all settings values.

Source Control Management

I hope you consider working with any revision control tool, even if you are working alone. Git, for instance, can do it locally. But lets consider that you will work with others and SCM is needed. Lets prepare your PC to deal with Git and Subversion.

$ sudo apt-get install git subversion

This is the most common revision control applications, Git for distributed version control and SVN for centralized repositories.

PHPFarm

If you need to work with an older version of PHP - for compatibility reasons, or if you want to test any beta version of PHP, then you will need to work with different versions of PHP that Ubuntu has on its repositories. It is a common knowledge that working with PHP natively on your development environment is the best solution, and it would be awesome to have PHP versions co-existing with no conflicts - PHPFarm is up to this task!

The author of this article suggests to skip this installation if you don’t need to work with different versions of PHP. Be warned that you will prepare you operational system to compile PHP, so it will have more software packages installed.

Installing PHPFarm

Let’s get the zip file of user cweiske’s[9] master branch from GitHub and install under /opt directory (you can also use git to clone his repository):

$ cd ~/Downloads
$ wget https://github.com/cweiske/phpfarm/archive/master.zip
$ sudo unzip master.zip -d /opt/
$ cd /opt
$ sudo mv phpfarm-master phpfarm

Integrate the phpfarm to your PATH:

$ echo "export PATH=/opt/phpfarm/inst/bin:$PATH" >> ~/.bashrc
$ source ~/.bashrc

Now, it is time to ensure that we will have all dependencies installed to compile a PHP version and to have Apache serving under FastCGI.

# Packages
$ sudo apt-get install apache2-suexec php5-dev php5-curl php5-gd php5-intl php-pear php5-imagick php5-mcrypt php5-memcache php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl libapache2-mod-fastcgi snmp libxpm-dev libjpeg-dev libpng++-dev libpspell-dev

# Compilers
$ sudo apt-get install autoconf automake curl build-essential re2c libxml2-dev

# Lib Mysql
$ sudo apt-get install libmysql++-dev

# curl
$ sudo apt-get install libcurl4-gnutls-dev

# php5-mcrypt
$ sudo apt-get install libmcrypt-dev

# php5-xsl
$ sudo apt-get install libxslt1-dev

# List of PHP extensions
$ sudo apt-get install libapache2-mod-php5 php5-cli php5-common php5-ming php5-ps php5-pspell php5-recode php5-sqlite

# Enable Apache modules
$ sudo a2enmod actions fastcgi suexec cgi rewrite
$ sudo service apache2 restart

Example: using PHP version 5.4.0

Lets start configuring our custom-options-5.4.0.sh file:

$ cd /opt/phpfarm/src
$ sudo gedit custom-options-5.4.0.sh

# Copy and paste the text below
configoptions="
        --with-libdir=/lib/x86_64-linux-gnu \
        --with-openssl \
        --with-pear \
        --with-iconv \
        --with-curl \
        --with-mysqli \
        --with-mysql \
        --enable-mbstring \
        --enable-exif \
        --with-jpeg-dir=/usr \
        --with-png-dir=/usr \
        --with-zlib \
        --with-zlib-dir \
        --with-png-dir=/usr \
        --with-gd \
        --with-gettext \
        --enable-gd-native-ttf \
        --with-mhash \
        --enable-ftp \
        --with-pspell \
        --with-mcrypt \
        --enable-bcmath \
        --with-pdo-mysql \
        --enable-sockets \
        --enable-soap \
        --enable-calendar"

include_path=".:/opt/phpfarm/inst/php-$version/pear/php/"
display_errors=On
log_errors=On
error_log=/tmp/php_errors.log

# Close the editor!

$ sudo chmod 755 custom-options-5.4.0.sh

Now we can compile PHP version 5.4.0:

$ sudo ./compile.sh 5.4.0

This first try will fail, because we need to patch libxml2-2.9.0[10]:

$ cd php-5.4.0
$ sudo wget https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
$ sudo patch -p0 -b < txtbgxGXAvz4N.txt
$ cd ..
# Try again to be happy!
$ sudo ./compile.sh 5.4.0
# Test your build
$ cd ../inst/php-5.4.0/bin
$ ./php -v

This last command will give you an output like below:

PHP 5.4.0 (cli) (built: Aug 26 2014 20:30:43) (DEBUG)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

As you can see, PHP is running on version 5.4.0.

Apache new dynamic host for a specific PHP version

To start integrating it with your development environment, we will need to ensure your localhost can answer for a new domain, like “dev54” (development with PHP 5.4), then we will configure Apache server, dnsmasq server and configure the CGI for Apache.

In order to avoid conflicts, the author recommends using a new localhost IP, like “127.0.0.3”.

Lets start a new site on Apache server, let’s create a new site configuration:

$ sudo gedit /etc/apache2/sites-available/default54.conf

Copy and paste the configuration below:

<VirtualHost 127.0.0.3:80>
  ServerName vhosts.dev54
  VirtualDocumentRoot "/var/www/%0"
  ServerAlias *.dev54
  UseCanonicalName Off

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel debug
  CustomLog ${APACHE_LOG_DIR}/access54.log combined
  ErrorLog ${APACHE_LOG_DIR}/error54.log

  ScriptAlias /php-fcgi/ /var/www/cgi-bin/

  <Directory "/var/www/">
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All
	Order allow,deny
	allow from all
    
	AddHandler php-cgi .php
	Action php-cgi /php-fcgi/php-cgi-5.4.0
	<FilesMatch "\.php$">
  		SetHandler php-cgi
	</FilesMatch>
  </Directory>
</VirtualHost>

<Virtualhost 127.0.0.3:443>
  ServerName vhosts.dev54
  DocumentRoot "/var/www"

  SSLEngine On
  SSLCertificateFile /etc/apache2/ssl/apache.crt
  SSLCertificateKeyFile /etc/apache2/ssl/apache.key
  ServerSignature On

 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel debug
 CustomLog ${APACHE_LOG_DIR}/access54.log combined
 ErrorLog ${APACHE_LOG_DIR}/error54.log
    
 ScriptAlias /php-fcgi/ /var/www/cgi-bin/

  <directory "/var/www">
	Options Indexes FollowSymLinks MultiViews
	AllowOverride all
	Order allow,deny
	allow from all

	AddHandler php-cgi .php
	Action php-cgi /php-fcgi/php-cgi-5.4.0
	<FilesMatch "\.php$">
  		SetHandler php-cgi
	</FilesMatch>
  </directory>
</virtualhost>

This configuration will make your Apache server work with CGI - that we will configure soon, integrating with PHPFarm generated scripts of our chosen PHP version - and will ensure that all domain ending with “dev54” is going to use PHP 5.4.0. Let’s enable it:

$ sudo a2ensite default54
$ sudo service apache2 reload

dnsmasq serving a new domain for a specific PHP version

To recognize your “*.dev54” on the Apache configuration, we are going to use dnsmasq, like we did before start using PHPFarm. Add this configuration on the end of your /etc/dnsmasq.conf:

$ echo "listen-address=127.0.0.3" | sudo tee --append /etc/dnsmasq.conf
$ echo "address=/dev54/127.0.0.3" | sudo tee --append /etc/dnsmasq.conf
$ sudo service dnsmasq restart

FastCGI for Apache Integration

Then we need to create the configuration for CGI, integrating with PHPFarm generated script on /opt/phpfarm/inst/bin/php-cgi-5.4.0.

$ mkdir /var/www/cgi-bin
$ gedit /var/www/cgi-bin/php-cgi-5.4.0

# Paste the configuration below:
#!/bin/sh
PHP_FCGI_CHILDREN=3 
export PHP_FCGI_CHILDREN 
PHP_FCGI_MAX_REQUESTS=5000 
export PHP_FCGI_MAX_REQUESTS 
exec /opt/phpfarm/inst/bin/php-cgi-5.4.0

# Close gedit
$ chmod 775 /var/www/cgi-bin/php-cgi-5.4.0

Well, if you’ve followed this article, you have /var/www/phpinfo.dev/index.php, that uses the latest version of PHP for Ubuntu Trusty Tahr (version 14), so we can now play with it:

$ cd /var/www
$ ln -s phpinfo.dev phpinfo.dev54

Yes, we can create a symbolic link to this same directory, using our new domain. If you browse http://phpinfo.dev54, you will see that phpinfo function prints “PHP Version 5.4.0”. Now you can create projects and compare how it is working for different versions of PHP. Go ahead and compile more PHP versions and create dynamic hosts for them!

Xdebug for a specific PHP version

Quoting Weiske (2011), “When using several PHP installations with phpfarm, installing PHP extensions is not always easy - mostly because Pyrus is very strict about package files - and many of the packages in PECL unfortunately have invalid non-validating package.xml’s.”

So we need to install and configure Xdebug for our specific PHP version. Please, note that you will download the latest version of Xdebug, so the name of the file may change.

$ cd /opt/phpfarm/
$ sudo pear download pecl/xdebug
$ sudo tar xzvf xdebug-2.2.5.tgz

According to Weiske (2011), the two things to remember are to use the correct phpize and php-config for the specific PHP version:

$ cd xdebug-2.2.5
$ sudo /opt/phpfarm/inst/bin/phpize-5.4.0
# It will give us this output:
  Configuring for:
  PHP Api Version:         20100412
  Zend Module Api No:      20100525
  Zend Extension Api No:   220100525
$ sudo ./configure --with-php-config=/opt/phpfarm/inst/bin/php-config-5.4.0
$ sudo make
$ sudo make install

We need to enable the extension in our php.ini file:

$ sudo gedit /opt/phpfarm/inst/php-5.4.0/lib/php.ini

# Copy and paste this configuration on the end of this file
; Xdebug configuration
zend_extension="/opt/phpfarm/inst/php-5.4.0/lib/php/extensions/debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

# Save and close the editor

$ sudo service apache2 restart

When you browse http://phpinfo.dev54/, the “Xdebug 2.2.5” will be next to Zend Engine logo.

Now it is possible to integrate Xdebug with your IDE and you can debug the specific domain for a PHP version, it will use its configured extensions.

Conclusions

As stated on the Introduction, now you can enjoy a PHP web development environment that is able to create a virtual host based on your directory name under /var/www, ready to use MySQL databases, HTTP and HTTPS protocols, debug and even test the same website for different PHP versions - all with native installations!

This great environment is something that developers may take some time to work with, so please take your time to evolve it writing your own scripts to speed up your development and your software quality, then build Virtual Machines in order easy your PHP web development environment for your projects. The author wrote this article to share his knowledge, then feel free to get in touch and share with your coworkers.

References

Ubuntu Wiki, ApacheMySQLPHP. https://help.ubuntu.com/community/ApacheMySQLPHP. Last visited on August 2nd, 2014.

Documentation webpage of Apache Module mod_vhost_alias, http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html. Last visited on August 2nd, 2014.

Rob Allen, Automatic Apache vhosts. http://akrabat.com/computing/automatic-apache-vhosts/. Last visited on August 3rd, 2014.

Ask Ubuntu website, How to avoid using sudo when working in /var/www?. http://askubuntu.com/questions/46331/how-to-avoid-using-sudo-when-working-in-var-www. Last visited on August 3rd, 2014.

Ubuntu 12.04 Server Guide, Databases Section, MySQL. https://help.ubuntu.com/12.04/serverguide/mysql.html. Last visited on August 12nd, 2014.

XDebug Documentation website. http://xdebug.org/docs/. Last visited on August 13rd, 2014.

Introducing phpfarm, Christian Weiske. http://cweiske.de/tagebuch/Introducing%20phpfarm.htm. Last visited on August 25th, 2014.

Running Apache with a dozen PHP versions, Christian Weiske. http://cweiske.de/tagebuch/Running%20Apache%20with%20a%20dozen%20PHP%20versions.htm. Last visited on August 25th, 2014.

Compiling and building PHP 5.3 on Ubuntu Linux, Artur Ejsmont. http://artur.ejsmont.org/blog/content/compiling-and-building-php-53-on-ubuntu. Last visited on August 26th, 2014.

Installing PHP extensions for phpfarm, Christian Weiske. http://cweiske.de/tagebuch/phpfarm-install-extensions.htm. Last visited on August 29th, 2014.

Appendix A - Apache2 Default Website

A screenshot of “Apache2 Ubuntu Default Page”, when browsing http://localhost/.

Apache2-localhost.png


[1] https://www.vagrantup.com/

[2] Ubuntu uses an Advanced Packaging Tool to perform operations on the existing software repositories, if it is new to you, consider reading Ubuntu’s documentation on https://help.ubuntu.com/14.04/serverguide/apt-get.html

[3] Execute “man chmod” on your terminal to read about the sticky bit

[4] http://www.thekelleys.org.uk/dnsmasq/doc.html

[5] Check http://goo.gl/bmTlwr and https://help.ubuntu.com/community/HowToZeroconf for more information

[6] http://php.net/manual/en/function.phpinfo.php 

[7] http://www.mysql.com/products/workbench/

[8] http://www.phpmyadmin.net/home_page/index.php

[9] Owner of phpfarm’s GitHub repository: https://github.com/cweiske/phpfarm 

[10] https://mail.gnome.org/archives/xml/2012-August/msg00028.html