Symfony 1.0 and 1.1 together! ;-)Announcements about Symfony 1.1 are becoming more frequent and with the creation of the 1.1 branch many users want to try it out and simply play around with 1.1 during the holiday season.

This guide is derived from InstallingMultipleVersionsOfSymfony and assumes you already have Symfony 1.0 installed (via PEAR) and running. Also note that i will use the PEAR directory to store Symfony 1.1 alongside my 1.0 installation, you can however put it wherever you like.

First off, check where your current Symfony installation is located. You could for example look at one of your projects “config/config.php” file – in my case it’s “/usr/lib/php/pear/symfony“, therefore i will be installing Symfony 1.1 one level above into “/usr/lib/php/pear“.

Create a directory for your installation and check out the current 1.1 branch:

sudo mkdir /usr/lib/php/pear/symfony_11
cd /usr/lib/php/pear/symfony_11
sudo svn co http://svn.symfony-project.com/branches/1.1 .

After the checkout is done, the next step is to create a symlink to the “symfony” php executable of the 1.1 checkout. You can find out where your current symfony command is stored with:

whereis symfony

In my case it’s located in “/usr/bin/“, that’s also where i will create the new symlink:

sudo ln -s /usr/lib/php/pear/symfony_11/data/bin/symfony 
/usr/bin/symfony1.1

(Note: It’s important to use absolute paths here)

With this done, you will still have your usual “symfony” command which is linked against your stable PEAR version but also a new “symfony1.1” command which is linked against your subversion checkout.
You can verify it easily by executing each command with the -V parameter.

If everything is working, create a new symfony 1.1 project (as you might already know, Symfony 1.1 features new CLI commands, you can see them by executing the “symfony1.1” command):

mkdir sf11test && cd !$
symfony1.1 generate:project foobar
symfony1.1 generate:app frontend
symfony1.1 generate:module frontend helloworld

Finally, the only thing left to do is to create a Virtual Host, it’s identical to the ones you created for your Symfony 1.0 project except for the path, don’t forget to change it to the location of your symfony 1.1 branch!

<Directory "/usr/lib/php/pear/symfony_11/data/web/sf/"> 
  AllowOverride All 
  Allow from All
</Directory>
<VirtualHost *:80>  
  ServerName sf11test  
  DocumentRoot "/Users/arthur/Webdev/sf11test/web"  
  DirectoryIndex index.php  

  Alias /sf /usr/lib/php/pear/symfony_11/data/web/sf/
  <Directory "/Users/arthur/Webdev/sf11test/web">    
    AllowOverride All    
    Allow from All  
  </Directory>
</VirtualHost>

Have fun!

Advertisements