post

Get Symfony Installed in 20 Minutes on Vista

Interest in Symfony has increased since del.icio.us announced it developed its new version on the Symfony framework. If you are running Vista and you need to get a quick Symfony development environment going, then look no further. Follow these easy steps to going in 20 minutes.

1. Install XAMPP

Just follow the instructions for installation and then:

  1. During the install, specify XAMPP to be installed under C:Program Files because of Vista security restraints.
  2. Run http://127.0.0.1/security/index.php to secure XAMPP.

2. Install Symfony

  1. Press the Win key
  2. Type cmd
  3. Press Ctrl+Shift+Enter
  4. Confirm the elevation prompt
  5. cd “C:Program Filesxamppphp”
  6. pear upgrade PEAR
    1. Note: You will get a pop-up with “CLI has stopped working”, you can safely close that (this will happen during the other command prompt steps as well).
  7. pear channel-discover pear.symfony-project.com
  8. pear install symfony/symfony
  9. pear install phing/phing

3. Setup Your Application

Add symfony to your path:

  1. Start Orb -> Computer (right click and choose properties)
  2. Advanced system settings
  3. Environment Variables…
  4. Click on the Path System variable and click edit
  5. At the end of the string, append ;C:Program Filesxamppphp;C:Program Filesxamppmysqlbin

Restart the command prompt for the path variable to set.

Set up a sample project:

  1. cd [path to your workspace]
  2. mkdir myproject
  3. cd myproject
  4. symfony init-project myproject
  5. symfony init-app myapp

4. Configure the Web Server

Set up a named host:

  1. Go to C:WindowsSystem32driversetc in explorer and right click on the host file. Uncheck the read only box.
  2. Hit the windows key
  3. Type notepad.exe
  4. Cntrl+Shift+Enter
  5. File -> Open
  6. Open C:WindowsSystem32driversetc (you will have to put an * in the file name box to see the file) and open the hosts file
  7. Add “127.0.0.1 myproject” under “127.0.0.1 localhost” (without the quotes)
  8. Save
  9. Go to C:WindowsSystem32driversetc in explorer and right click on the host file. Check the read only box.
  10. File -> Open
  11. C:Program Filesxamppapacheconfextra (you will have to put an * in the file name box to see the file) and open httpd-vhosts.conf
  12. Add this to the end of the httpd-vhosts.conf file and save:
    <VirtualHost *:80>
    ServerName myproject
    DocumentRoot “C:[path to your workspace]myprojectweb”
    DirectoryIndex index.php
    Alias /sf C:php5peardatasymfonywebsf
    <Directory “C:php5peardatasymfonywebsf”>
    AllowOverride All
    Allow from All
    </Directory>
    <Directory “C:[path to your workspace]myprojectweb”>
    AllowOverride All
    Allow from All
    </Directory>
    </VirtualHost>
  13. Uncomment ##NameVirtualHost *:80 if you want to have more than one project able to run with different names.
  14. Restart Apache and go to http://myproject/ and you should see the symfony default project page.

5. Setup File Folder Permissions

Now you need to allow for write access to the cache and log folder.

  1. Traverse to each those two directories seperately within your newly Symfony file structure with Explorer.
  2. Right click on each of the folders and choose properties
  3. Go to the security tab and choose the user that will be granted the permissions and click edit.
    1. Note: You can find out the user by Cntrl+Alt+Delete, and then starting the task manager. Note the User Name.
  4. Allow that person to have full control.

NEXT STEPS

I suggest you install Aptana or PHPEclipse for your IDE.

You will also want to setup TortoiseSVN or use SVN from inside Cygwin for a version control client.

The Askeet tutorial is a good way to learn about programming in Symfony.

If you prefer learning on paper, I suggest you check out the official Symfony book: The Definitive Guide to symfony (Definitive Guide). Or read it online free here.

Comments

  1. steve says:

    Nice tutorial, made life much easier. Thank you so much.

  2. xanders says:

    i cant seem to get pear working with xampp 1.4.7 and vista? any suggestions?

    c:Program Filesxamppphp>pear
    ‘pear’ is not recognized as an internal or external command,
    operable program or batch file.

  3. filmaker83 says:

    I have the same problem of xanders

  4. Frankie says:

    Try the go-pear.bat in your XAMPP Pear Dir & Follow the Instructions

    Greez

  5. jjmontgo says:

    Please add the following to your instructions:

    “pear channel-discover pear.phing.info”

    This should be step number 9.

    (Thanks for the great tutorial!)

  6. jjmontgo says:

    Under 4. Configure Web Server, Step 8, getting the following error message:

    “Cannot create the C:WindowsSystem32driversetchosts” file.

    Make sure that the path and file name are correct.”

    The file is not read-only. It doesn’t appear to be possible to edit it.

  7. @jjmontgo

    You need to open notepad as an administrator to be able to edit the hosts file.

    Thanks for the contribution!

  8. Forrester says:

    I appreciate this tutorial, but good gawd… day three and I finally got XAMPP up and running. For me, this was definitely not a “20 minute” undertaking. At this rate, I’ll be lucky if it’s working after 20 days!

  9. jacques says:

    Really usefull for me. Thanks a lot !

  10. mohsin says:

    Hi,

    Its a very good tutorial. But I am facing some problem with installing symfony.

    I want to install symfony with pear.
    I have installed pear.

    After that I run the command:
    pear channel-discover pear.symfony-project.com

    and it replied with:
    Channel “pear.symfony-project.com” is already initialized

    Then I run the command:
    pear install symfony/symfony-1.2.7

    After sometime it replied with:
    ……………………………………….
    …………… done: 2,695,475 bytes
    -

    Now a cursor is blinking and nothing happens. I waited for around half an hour and it did not work and symfony is not installed…

    Any clue..

  11. jefjef says:

    its just loading

  12. bayarja says:

    hi everyone. is it same installing on xp?

  13. valentina says:

    I need some help.
    I get stuck on the ‘symfony init-project myproject ‘. It gives me
    ‘ Task “init-project” is not defined’.

  14. chip says:

    Symfony Task “init-project” is not defined. thanx.

Trackbacks

  1. [...] installing on Vista. There is a link out to external blog where others have advice on setting up on Windows Vista, but that was all I could find.  But after a day just trying to get the test environment running [...]

Speak Your Mind

*