Preface
Please understand that this is not a complete how-to guide. There are a lot of things missing from this that you would need to run a site like mine. I just included the bare minimum required to get Apache 2.4, PHP-FPM, MariaDB, and Composer up and running on Ubuntu 14.10. You may find that you need other PHP5 libraries, such as php5-gd, installed as well for this to run your PHP web app of choice. That said, this should be enough to get you started!
Installation
To get started, we will first ensure that we are running the most up to date packages:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
Next, we will install the following dependencies:
sudo apt-get install apache2-mpm-event apache2-utils libapache2-mod-fcgid php5-fpm php5-cli php5-mcrypt php5-mysqlnd curl mariadb-server mariadb-client mariadb-common
Next, install Composer:
curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer
Configuration
We will need to create ourselves a lovely configuration file for PHP-FPM, and save it as php5-fpm.conf:
<FilesMatch .php$> SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost/" </FilesMatch> <IfModule dir_module> DirectoryIndex index.php index.html </IfModule>
Next we will enable our mods and configurations:
sudo a2enmod fcgid proxy_fcgi sudo a2enconf php5-fpm sudo service php5-fpm restart sudo service apache2 restart sudo service mysql restart
Testing
Create a file within /var/www/html and call it test.php
<?php phpinfo();
Navigate to http://localhost/test.php, if you get the output of phpinfo(), then you’ve done everything correctly!
Have fun, and enjoy! Please comments, questions, and corrections below!