YASB – Yet Another Symfony Blog

February 27, 2008

Installing Symfony 1.1 SVN and Symfony 1.0 PEAR packages side-by-side: A Windows Vista How-To (and XP, too)

Filed under: General, PHP, Tips and tricks — Krof Drakula @ 4:37 pm

As a tie-in to this excellent how-to for installing both versions of Symfony, I’ve decided to extend the method to apply to Vista as well.

EDIT: Symlinks don’t work this way because of the working directory being in C:\PHP where the symlink is located. See below for modified instructions.

First, check out the SVN branch for 1.1 to a directory of your choosing – this can be located anywhere on any storage volume. When the checkout’s done, open a command prompt and navigate into your PHP directory where symfony.bat is already located. In my case, this is C:\PHP and my checkout is D:\Projects\symfony-1.1. As Vista comes with an NTFS file system capable of UNIX-like (not quite, but close enough) symlinks (thanks to camason on #symfony for pointing that out to me), you can create a symlink to Symfony 1.1’s batch file using mklink (you’ll need a command prompt with elevated privileges for this to work):

C:\PHP> mklink symfony-1.1.bat d:\Projects\symfony-1.1\data\bin\symfony.bat

This creates a symbol link to the symfony.bat executable – now I can (assuming I have PATH set to C:\PHP) run symfony-1.1 at the command prompt from anywhere and can use the new branch with the same ease of use as the original article.

Unfortunately, due to symlinks executing with the working directory being in C:\PHP, you’ll get Symfony v. 1.0.x instead. To overcome this, delete the symlink and create a symfony-1.1.bat with the following contents:

@cmd /c d:\Projects\symfony-1.1\data\bin\symfony.bat %*

That will fix the working directory problem and correctly execute Symfony 1.1.


  1. Hi thanks for the information, I was figuring this out but you clarified me the job. I am using XP and the las step did not work, when I executed the batch the script result in the list of the commands of symfony 1.1 so the problem was that the parameters were not sent to the original .bat so a little add fixed this, my personal symfony11.bat is this:

    @cmd /c C:xampphtdocssymfony11databinsymfony.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

    that way everything worked fine, I put this file in c:xamppphp the same path where the original symfony.bat (autogenerated using PEAR) is located.

    Thanks Again

    Comment by neonard0 — March 30, 2008 @ 9:24 pm

  2. Ah, true enough, I’ve missed passing the arguments in the batch file.

    Comment by Krof Drakula — March 31, 2008 @ 11:13 pm

  3. you should put %* instead of %1 %2 %3 etc…

    Comment by roelf — May 23, 2008 @ 2:47 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress