Symfony describes itself as …
[...] a PHP framework for web projects.
Speed up the creation and maintenance of your PHP web applications. Replace the repetitive coding tasks by power, control and pleasure.
Building a website with Symfony. First of all you need a development environment. This is what my development environment looks like:
- Sublime Text 2
- My self-compiled Vagrant box for local Linux environment.
- Version control with Git. (GitTower)
- MouApp for editing Markdown files.
You can download Symfony Standard Edition from the symfony.com homepage or you can install it with Composer.
I used Composer because you can better manage extra packages and bundles for Symfony too.
$ composer.phar create-project symfony/framework-standard-edition project_directory/ 2.3.4
You will be prompted for standard configuration settings. Also see app/config/parameters.yml
. Read the Installing and Configuring Symfony documentation for detailed information about how to install and configure Symfony.
This first problem I got was a write error for the directories app/cache
and app/logs
. The main problem was that the /var/www
directory is mounted to the local work
directory as user vagrant
. The Apache process runs under www-data
. So I decided to run the Apache process also as vagrant
. With a live production server (maybe Debian) you don’t need to run Apache as another user as www-data
because you only set the owner and the group of app/cache
and app/logs
to www-data
. Run the following as root
in your Symfony base directory.
$ chown -R www-data:www-data app/cache app/logs
This problem is only in the Vagrant box because the /var/www
directory is mounted to your local machine.