Created: 2012-03-26 06:11
Updated: 2016-01-23 15:22

Silex Boilerplate

This is a simple boilerplate for an application written with the Silex PHP microframework. It is intended to be a starting point for a REST Web application. It comes with Twig, MongoDB, and LESS support by default.


Installation is very easy. It makes use of Composer for PHP as well as git submodules for dependencies not yet available as a Composer package. Open up a new Terminal window and run this command:

$ curl -S | sh

This will create a new directory silex-boilerplate in the current working directory and install all dependencies for the project.

If you have PHP 5.4 installed, you can simply run the following and start a new local development server to test out your app:

$ php -S localhost:8080 ./silex-boilerplate


You must give write access to the system/logs directory for Monolog to be able to do its job. Also, to use LESS compilation, the component needs write access to app/assets/css and app/assets/less. Use something similar to the following if you encounter any problems:

$ chmod a+w system/logs app/assets/less app/assets/css

You must also have the less node.js binary and library files installed in your system for the LESS component to function successfully. Install it with the following:

$ npm install -g less


I intend to integrate this fully with Backbone Boilerplate as a backend/REST portion of the framework.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more