Install and Use the Fat-Free Framework for PHP

Leave your reply


Learn how to install and use Fat-Free Framework for PHP, a microframework which is both powerful and easy to use. Fat-Free Framework allows developers to build entire websites quickly and reliably.

Fat-Free Framework (also called "F3") is an open source framework for PHP which is designed to be lightweight and easy to use. Loosely modeled on Ruby's Sinatra framework, Fat-Free has a robust core functionality, a full-featured toolkit, and a growing library of plug-ins.

Note: For any Cloud Server with Plesk, applications like F3 should always be installed and managed through the Plesk interface.


  • A Cloud Server running Linux (CentOS 7 or Ubuntu 16.04)
  • PHP installed and configured, version 5.4 or higher

Use the command php -v to check your PHP version:

[user@localhost ~]# php -v
PHP 5.4.16 (cli) (built: Nov  6 2016 00:29:02)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

In this example, the server is running PHP version 5.4.16.

Install Fat-Free Framework

To install Fat-Free Framework, you will need to download the master distribution package to your project directory and unzip the file.

If security is a concern, you may want to put the default folders in a directory which is not available from the web. For this tutorial, we will put everything in the main web directory.

Move to the main web directory:

cd /var/www/html

Download the master distribution package:

sudo wget

Ubuntu 16.04 only: Install the unzip utility: sudo apt-get install unzip

Unzip the distribution package:

sudo unzip

A Simple "Hello World" Test

To test the installation, we will use a simple "Hello World" script recommended by the Fat-Free Framework documentation. Create the file index.php and open it for editing:

sudo nano index.php

Put the following content into the file:

$f3 = require('fatfree-master/lib/base.php');
$f3->route('GET /',
    function() {
        echo 'Hello, world!';

Note: the first line of the script $f3 = require('fatfree-master/lib/base.php'); needs to use the relative path to the base.php file. If you have installed the files in a different directory, or renamed the fatfree-master directory, you will need to update this file path accordingly.

Save and exit the file. Switch to a browser and visit your domain's root URL ( If Fat-Free Framework has been installed correctly, you will see the message "Hello, world!"