Install Symfony - Windows XP / Vista + WAMP
Krzysztof Karolczak | Friday February 29th, 2008How to quickly and easily install Symfony Framework on Windows? A 15 minute guide that will let you start the fun right away!
I’m assuming that you’re working on Windows XP or Vista and starting from scratch - that means without any WWW server configured on the machine.
What will we need?
- WAMP (version 2.0 at the moment of writing)
- and… that’s all!
Using WAMP we’ll install PEAR and Symfony right afterwards, but starting from the beginning:
Part 1 - Installing WAMP
WAMP is a self-installing, all-in-the-box package with Apach, MySQL and PHP 5 - and that’s exactly what we need (there is also PHPMyAdmin and SQLitemanager included which is nice and may come in handy). Of course it’s not the only pack like that available on the internet, very similar to WAMP is for example XAMPP - the choice is up to you. You could also install all the components manually… but what’s the point?
WAMP will auto-extract it’s files (let’s say under C:\wamp) and start off without any problems. Voila! - a running server with default configuration! That was fast, wasn’t it
You can configure WAMP’s elements by clicking its tray icon. (You can also translate WAMP to a variety of languages - right click on the icon and see for yourself :))
If your WAMP fails to start and you get a warning that port 80 is being used (and you don’t have another HTTP server running on the machine) - it can be Skype. Make sure that in Skype’s options (Advanced >> Connection) the checkbox about using port 80 as alternative port for incoming connections is not ticked.
Symfony needs PHP-XSL and Apache URL Rewrite Module to function normally (which are off by default). Let’s start by activating the Rewrite module - left click on WAMP’s tray icon and than in Apache >> Apache Modules menu select rewrite_module (server will automatically reboot). Now it’s time for XSL, as in the step before: - in PHP >> PHP Extension menu look for php_xsl and click it. But there is one more php.ini file, which WAMP won’t change (no clue why) - we need to do it by hand, let’s open: C:\wamp\bin\php\php5.2.5\php.ini and remove “;” from the line:
;extension=php_xsl.dll
Now we should add environment variables to have access to PHP i MySQL under the command line. Right-click on My Computer, than Properties. Switch to Advanced tab and click the Environment Variables button. At the end of variable PATH let’s add ;C:\wamp\bin\php\php5.2.5;C:\wamp\bin\mysql\mysql5.0.45\bin (paths to MySQL and PHP files separated by a semicolon).
Part 2 - PEAR Install
PEAR (PHP Extension and Application Repository) is a PHP extension distribution system. Installation files are bundled with PHP by default, so this won’t take us long.
In the WAMP’s PHP directory (ie. C:\wamp\bin\php\php5.2.5\) run the go-pear.bat file. Follow the installation steps and answer the questions, the default config should be fine, so you can answer:
- [Enter] (default value) - if we want PEAR installed systemwide.
- [Enter] - if we don’t want to change de directory structure.
- Y - we allow PEAR to modify our php.ini.
- And [Enter] twice to finish.
Inside the PHP directory the installer created a PEAR_ENV.reg file, which after double-clicking will add all the PEAR variables to the registry - no need to do it by hand.
Part 3 - Finally the Symfony
Open the command line and write:
> pear channel-discover pear.symfony-project.com
If everything goes wel, you’ll see:
Adding Channel “pear.symfony-project.com” succeeded
Discovery of channel “pear.symfony-project.com” succeeded
So the time has come, write the magic line:
> pear install symfony/symfony
The download of the package shouldn’t take long (~2 MB), and PEAR automates the whole process.
Part 4 - Your first Symfony project
Considering everything went smooth you can now write in the command line:
> cd C:\wamp\www
> mkdir myproject
> cd myproject
> symfony init-project myproject
> symfony init-app testapp
Congratulations! The effects of your work can be seen at http://127.0.0.1/myproject/web/
And that’s that. I wish you many successful projects in Symfony






Bardzo zwięzła i pomocna informacja jak zainstalować pear, symfony i
anurit.pl | Friday April 18th, 2008Bardzo zwięzła i pomocna informacja jak zainstalować pear, symfony i jeden z lamp-ów.
[...] Symfony Framework installation guide. [...]
Symfoclipse - Symfony Development Tools for Eclipse | Poetry of Programming | Monday May 5th, 2008[...] Symfony Framework installation guide. [...]
Wonderful guide !!!!.. thanks a lot dude...
santhosh Palan | Wednesday May 7th, 2008Wonderful guide !!!!.. thanks a lot dude…
Good straightforward no bs guide. Thanks!
nm | Wednesday June 4th, 2008Good straightforward no bs guide. Thanks!
If you are behind a proxy, you need to setup
Pedro Guerreiro | Thursday June 12th, 2008If you are behind a proxy, you need to setup PEAR to use the proxy, before you install symfony, in Part 3. Do this:
pear config-set http_proxy http://yourproxy:portReplace yourproxy with your proxy address, and port with your proxy port.
Thanks - this was the only guide i tried that
Neal Sherman | Thursday June 12th, 2008Thanks - this was the only guide i tried that worked - I am now at the point where i created a test project. I get the welcome screen but no images and I have no idea what it is asking me to do
the error is “This project uses the symfony libraries. If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory.”
Can someone help here
thanks
Thank you for the guide! It's very useful!
kaki | Friday June 13th, 2008Thank you for the guide! It’s very useful!
The First Page don't show in myproject what i have to
Rodrigo | Saturday June 21st, 2008The First Page don’t show in myproject
what i have to do?
everthing is correctly in your guide but the page of symfony don`t show in my pc is writen that:
If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory.
where i can do this?
Thanks, handy guide indeed. Easy enough to follow although I'm
Amir Hamzah | Friday July 18th, 2008Thanks, handy guide indeed. Easy enough to follow although I’m not using the “self installing WAMP” (I install all the components manually); I manage to done this.
Thanks again.
swietny przewodnik, dokladnie czegos takiego szukalem, wielkie dzieki!
yaqoob | Friday August 1st, 2008swietny przewodnik, dokladnie czegos takiego szukalem, wielkie dzieki!
Wszystko działa tak jak jest napisane. Rewelacja. Dziękuję bardzo i
wojtek77 | Saturday August 2nd, 2008Wszystko działa tak jak jest napisane. Rewelacja. Dziękuję bardzo i pozdrawiam.
Krzysztof way to sexy tutorial, works perfect! youre awesome!
Adi | Saturday August 2nd, 2008Krzysztof
way to sexy tutorial, works perfect! youre awesome!
[...] assuming that you have Symfony already properly installed (if
Setting the web server to gain access to symfony_data/web/sf/ directory | Poetry of Programming | Friday August 8th, 2008[...] assuming that you have Symfony already properly installed (if not the installation guide is here). I’m working on a WAMP installation of Apache+MySQL+PHP, so the directory paths in my [...]
For a guide on setting the web server to gain
Krzysztof Karolczak | Friday August 8th, 2008For a guide on setting the web server to gain access to symfony_data/web/sf/ directory go here
It solves the “If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory.” issue :).
Bardzo pomocny tutorial.Bardzo dziękuje :)
Tomek | Sunday September 7th, 2008Bardzo pomocny tutorial.Bardzo dziękuje
I had followed a much more complicated tutorial: - http://trac.symfony-project.org/wiki/HowToInstallPearOnWindowsWithWamp - http://trac.symfony-project.org/wiki/HowToInstallSymfonyOnWindowsWithWamp but
Olivier Bridgeman | Thursday September 11th, 2008I had followed a much more complicated tutorial:
- http://trac.symfony-project.org/wiki/HowToInstallPearOnWindowsWithWamp
- http://trac.symfony-project.org/wiki/HowToInstallSymfonyOnWindowsWithWamp
but this one is simpler
hey all the procedures went well but when i tested
shrat | Thursday September 18th, 2008hey all the procedures went well
but when i tested it it said
Fatal error: Uncaught exception ‘InvalidArgumentException’ with message ‘The application “” does not exist.’ in C:\wamp\www\sf_sandbox\lib\symfony\config\sfProjectConfiguration.class.php:328 Stack trace: #0 C:\wamp\www\sf_sandbox\test\bootstrap\functional.php(22): sfProjectConfiguration::getApplicationConfiguration(”, ‘test’, true) #1 {main} thrown in C:\wamp\www\sf_sandbox\lib\symfony\config\sfProjectConfiguration.class.php on line 328
pls help me
If you are testing a sandbox it doesn't need Symfony
Krzysztof Karolczak | Thursday September 18th, 2008If you are testing a sandbox it doesn’t need Symfony installed - create and test a normal project instead and see if it works. And read about running sf sandbox on the symfony-project.org forum.