Symfony2 - Creating a REST API - Part 1

Introduction

This tutorial aims to get someone who is completely new to Symfony2 setup with a very basic REST API with Symfony, from scratch, as quickly and as simply as possible.

The majority of this tutorial is based on the video below, which I found to be incredibly useful, but far too quick to follow which resulted in me creating this tutorial. This tutorial will also be kept up-to-date and fix some of the issues that have since arisen due to updates.

Steps

Defines

Firstly, register some variables in your shell that we will use throughout this tutorial

# Specify a name for your project
PROJECT_NAME="test_project"
# This should be the name of your organization, or your personal pseudonym
USERNAME="Programster"
# This must end with "Bundle" and use Camelcase
BUNDLE_NAME="DemoBundle"

We use sudo in the command above to removes the possible ErrorException

mkdir: permission denied

Answer the Questions

At this point it will ask you a series of questions. I elected to NOT install the Acme demo bundle and use the mysqli database_driver.
When the secret option comes up, make sure to create something new and write it down for now