Recently I switched my main PHP framework to learn another, Symfony. I am running a Ubuntu server and recently upgraded to the new distribution and was looking into how to set up the Symfony framework. If you are a beginner then the sandbox_sf file will do, but if you are looking to set it up for more than one page below will show how to install and set it up so all websites will use it.
Before starting you will need to install Apache2, PHP5, and MySQL. In Ubuntu that is an easy task completed by the following command that will pretty much cover all the required packages.
That is it! You have symfony installed on your system for use. Now lets setup a simple project for personal use. The project name I will use is “myproject”, you can use any name that you prefer.
I will move to the directory which is the document root for apache, create my project directory, initialize a new project with symfony and create a new front end.
Next we have to create a symlink that will allow the new project that we just created to use the Symfony libraries and elements installed earlier. With us still within the “/var/www/< project name >”
http://< ip address >/myproject/web/
If you get the image below
the installation was successful, you can now create an alias that will allow you to view the project without having to go to the “web/” directory. For that we will need to add a new alias within the sites-enabled folder for apache. I only have one site on my computer so my file is named “000-Default”, yours might be something totally different.
Save, quit and restart Apache. Now all you have to do is go to your address http://< ip address >/myproject and see the image above and you are DONE! Now was that easy or what?!?
Stay tuned for more Symfony joy.