Set up symfony 1.2 on Debian/Ubuntu

Just wanted to give symfony a try and ran into some issues to set it up the way I wanted. Therefore I’d like to note the required steps.

First, install symfony via PEAR.

pear channel-discover pear.symfony-project.com
pear install symfony/symfony-1.2.4

This sould install symfony and make the symfony executable available in your PATH.

~$ symfony -V
symfony version 1.2.4 (/usr/share/php/symfony)

Create a directory for your vhost and create a new project.

mkdir /var/www/myproject
cd /var/www/myproject
symfony generate:project myproject

Create an example application in your project.

symfony generate:app frontend

Link the symfony resources to the project’s document root.

cd web
ln -s /usr/share/php/data/symfony/web/sf/

This should get you up and running with symfony. You just need to configure your server for the vhost. For personal preference, I’d like to have my document root directory named public instead of web. The following steps are needed to achive this.

Rename the document root directory.

mv web public

Add this line to config/ProjectConfiguration.class.php:

<?php
public function setup()
{
    $this->setWebDir($this->getRootDir() . '/public');

    // for compatibility / remove and enable only the plugins you want
    $this->enableAllPluginsExcept(array('sfDoctrinePlugin', 'sfCompat10Plugin')$
}