search
top

How to create a webserver based on Ubuntu Server

Goal

The result of following this tutorial should be a (local) webserver that’s built with the following packages:
- Apache2, the actual webserver.
- PHP5, the popular language.
- MySQL, so we can make use of databases.
- SSH, this enables us to reach our server through both SSH and (S)FTP.

This tutorial only covers the installation of the actual server. After the server is installed we’ll still need to create our first website and database.

(more…)

Add a leading zero to an integer (useful for month numbers) in PHP

This loop prints every month number with leading zero’s:

for($i=1; $i <= 12; $i++):
     echo sprintf('%02s', $i);
endfor;

top