Installation
There are four ways to install the Symfony framework:
- Download the archive file in the root of our project and unpack it there
- Clone the project from GitHub
- Use the Symfony installer tool
- Use Composer to install it for us
The easiest way is to download the Symfony installer and make it publicly accessible via the following commands:
$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony $ sudo chmod a+x /usr/local/bin/symfony
Now create a new project simply by running the following command:
$ symfony new mava
As this command shows, it will ask the Symfony installer to create a new folder in the current path called
mava
, and when you hit enter, you will see that the Symfony source code will be downloaded to that folder:
Note
If you don't mention a version number or branch name in the installer command, it downloads and installs the latest stable version of Symfony.
In the list of things that we can do after installation is running the application immediately, without installing a virtual host. Thanks to the PHP built-in web server, we can run it via Symfony's console and browse the mava app at port 8000
on localhost:
$ bin/console server:run
The following screenshot shows how http://localhost:8000
looks like in your favourite browser:
Tip
Downloading the example code
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
- Log in or register to our website using your e-mail address and password.
- Hover the mouse pointer on the SUPPORT tab at the top.
- Click on Code Downloads & Errata.
- Enter the name of the book in the Search box.
- Select the book for which you're looking to download the code files.
- Choose from the drop-down menu where you purchased this book from.
- Click on Code Download.
You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR / 7-Zip for Windows
- Zipeg / iZip / UnRarX for Mac
- 7-Zip / PeaZip for Linux