Poetry of Programming

Because coding is art
  • rss
  • Home
  • Search

Install Symfony – Windows XP / Vista + WAMP

Krzysztof Karolczak | Friday February 29th, 2008

How to quickly and easily install Symfony Framework on Windows? A 15 minute guide that will let you start the fun right away!

I assume that you’re working on Windows XP or Vista and starting from scratch – that means without any WWW server configured on the machine – this guide will cover all of that :) .  Enjoy! :)

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 Apache, MySQL and PHP 5 (5.2.8+) – 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 on most installs). 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 sometimes won’t change (no clue why) – we need to do it by hand, let’s open: C:\wamp\bin\php\php5.2.8\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 something like ;C:\wamp\bin\php\php5.2.8;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.8\) run the go-pear.bat file. Follow the installation steps and answer the questions, the default config should be just fine.

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.

Finally, to check if Symfony is installed correctly write:

symfony -V

Which should print out on the screen the version of Symfony you’ve just downloaded.

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

For Symfony 1.2 the proper way to init a project is:

> symfony generate:project myproject
> symfony generate:app —escaping-strategy=on —csrf-secret=Unique$ecret testapp

When calling the generate:app task, we have also passed two security related options:

  • –escaping-strategy – Enables output escaping to prevent XSS attacks
  • –csrf-secret – Enables session tokens in forms to prevent CSRF attacks

Yes, Symfony 1.2 will automatically protect us from the two most widespread vulnerabilities found on the web!

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 :)

If you want to move on from here (with your brand new Symfony Framework on-board ;) ):

  • See my guide on configuring Apache to work hand in hand with your Symfony applications.
  • Visit the Symfony official web page and enjoy the variety of guides, tutorials and well written documentation.

Categories
Installation, Symfony
Tags
framework, PHP, Symfony 1.0, Symfony 1.1, Symfony 1.2
Comments rss
Comments rss
Trackback
Trackback

Conversion table for px, pt, em and % in CSS »

55 responses

Bardzo zwięzła i pomocna informacja jak zainstalować pear, symfony i

anurit.pl | Friday April 18th, 2008

Bardzo 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, 2008

Wonderful guide !!!!.. thanks a lot dude…

Good straightforward no bs guide. Thanks!

nm | Wednesday June 4th, 2008

Good straightforward no bs guide. Thanks!

If you are behind a proxy, you need to setup

Pedro Guerreiro | Thursday June 12th, 2008

If 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:port

Replace 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, 2008

Thanks – 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, 2008

Thank you for the guide! It’s very useful!

The First Page don't show in myproject what i have to

Rodrigo | Saturday June 21st, 2008

The 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, 2008

Thanks, 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, 2008

swietny przewodnik, dokladnie czegos takiego szukalem, wielkie dzieki!

Wszystko działa tak jak jest napisane. Rewelacja. Dziękuję bardzo i

wojtek77 | Saturday August 2nd, 2008

Wszystko 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, 2008

Krzysztof

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, 2008

For 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, 2008

Bardzo 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, 2008

I 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, 2008

hey 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, 2008

If 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.

VERY HELPFUL!!!! THANK YOU!!!!

icyblue | Thursday October 23rd, 2008

VERY HELPFUL!!!! THANK YOU!!!!

super dzięki

Tasior | Sunday October 26th, 2008

super dzięki

PANALO

stevedevera | Monday November 3rd, 2008

PANALO

excellent guide!

123 | Tuesday November 11th, 2008

excellent guide!

Witam a ja mam taki problem: Gdy wpisuje > symfony init-project

pejot | Tuesday November 25th, 2008

Witam a ja mam taki problem:
Gdy wpisuje > symfony init-project mojprojekt dostaje

C:\wamp\www\mojprojekt>symfony init-project mojprojekt
The system cannot find the path specified.

Mój symfony.bat wyglada tak:

@echo off

rem *************************************************************
rem ** symfony CLI for Windows based systems (based on phing.bat)
rem *************************************************************

rem This script will do the following:
rem - check for PHP_COMMAND env, if found, use it.
rem - if not found detect php, if found use it, otherwise err and terminate

if ?%OS%?==?Windows_NT? @setlocal

rem %~dp0 is expanded pathname of the current script under NT
set SCRIPT_DIR=%~dp0

goto init

:init

if ?%PHP_COMMAND%? == ?? goto no_phpcommand

IF EXIST ?.\symfony? (
%PHP_COMMAND% ?.\symfony? %1 %2 %3 %4 %5 %6 %7 %8 %9
) ELSE (
rem %PHP_COMMAND% -d html_errors=off -d open_basedir= -q %SCRIPT_DIR%\symfony %1 %2 %3 %4 %5 %6 %7 %8 %9
%PHP_COMMAND% -d html_errors=off -d open_basedir= -q C:\wamp\bin\php\php5.2.6\ symfony %1 %2 %3 %4 %5 %6 %7 %8 %9
)
goto cleanup

:no_phpcommand
rem echo ????????????????????????
rem echo WARNING: Set environment var PHP_COMMAND to the location of your php.exe
rem echo executable (e.g. C:\PHP\php.exe). (assuming php.exe on PATH)
rem echo ????????????????????????
set PHP_COMMAND=C:\wamp\bin\php\php5.2.6\php.exe
goto init

:cleanup
if ?%OS%?==?Windows_NT? @endlocal
rem pause

A nadmienię jeszcze ze nie mam folderu symfony w C:\wamp\bin\php\php5.2.6\

I like it. Thanks for instal quite. It's realy usefull.

Jav | Wednesday November 26th, 2008

I like it. Thanks for instal quite. It’s realy usefull.

#pejot a zwraca Ci coś polecenie symfony -V? I zobacz

Krzysztof Karolczak | Sunday November 30th, 2008

#pejot a zwraca Ci coś polecenie symfony -V? I zobacz czy jeśli odpalisz symfony.bat znajdując się bezpośrednio w folderze symfony czy działa…

Hi there ! I've followed this tuto, really useful and

BluePyth | Monday December 22nd, 2008

Hi there !

I’ve followed this tuto, really useful and helpful too ;)

Just a thing, now the line ti uncomment in the php.ini file is modified automatically, seems like the author of wamp as fixed this bug ;)

Bye !

Hey, i follwed the tutorial as i had no experience

Iltar | Tuesday December 30th, 2008

Hey, i follwed the tutorial as i had no experience with symfony on windows (i do on linux). But i get a message that php.exe could not be found…

Use:
C:\ServerT\bin\php\php5.2.8>cd C:\ServerT\www\stage-verslag
C:\ServerT\www\stage-verslag>symfony
‘php.exe’ is not recognized as an internal or external command,
operable program or batch file.

Why is that? (using wamp 2.0f)

Did you set the environment variables to point your php

Krzysztof Karolczak | Friday January 2nd, 2009

Did you set the environment variables to point your php binary? Read the paragraph just before the Part 2 of the tutorial :) .

Świetna pomoc, dzięki wielkie.

krzysztof | Sunday January 25th, 2009

Świetna pomoc, dzięki wielkie.

"Part 3 - Finally the Symfony" On windows cmd I will execute

alexis | Sunday March 1st, 2009

“Part 3 – Finally the Symfony”

On windows cmd
I will execute pear command but inside what directory have to be my prompt?

d:/ pear ….. ?

Very very thanks for given a exact guideline

pavan | Monday March 2nd, 2009

Very very thanks for given a exact guideline

@alexis if you've run the created PEAR_ENV.reg file after the

Krzysztof Karolczak | Monday March 2nd, 2009

@alexis if you’ve run the created PEAR_ENV.reg file after the Pear installation than you should be able to run pear from anywhere (you might need to restart your console for that).

Na koćcu powinno byc chyba: symfony generate:project mojprojekt symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret

arcz | Saturday March 7th, 2009

Na koćcu powinno byc chyba:

symfony generate:project mojprojekt
symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret testapp

A tutaj mily 24-godzinny tutorial (w wersji angielskiej są dostępne wszystkie lekcje)

Podziękowania za instrukcje dla windy!

thank you so much for this guide ... I've been

arpi | Tuesday April 7th, 2009

thank you so much for this guide … I’ve been struggling all day trying to install symfony and it took me 10 minutes with your instructions!

You just nailed it! Thank you very much. This is a

Jess | Thursday April 30th, 2009

You just nailed it!

Thank you very much. This is a very helpful reference.

Hi! Very Very Helpful article for

Malay Mehta | Tuesday May 19th, 2009

Hi!
Very Very Helpful article for the newbies to Symfony. Thanks for all the efforts!!!!!

Technically Yours,
Malay Mehta

thx, finally got it working. still new to Symfony so

Maarten De Bal | Wednesday June 10th, 2009

thx, finally got it working.

still new to Symfony so will explore it in the next weeks

Cześć dzięki że zamieściłeś ten tekst, bo ciągle mało po

leon | Thursday July 2nd, 2009

Cześć dzięki że zamieściłeś ten tekst, bo ciągle mało po polsku o symfony,
ale niestety mam problem, zrobilem wszystko do 3 punktu i jak wpisuje w konsoli:

> pear channel-discover pear.symfony-project.com

to mi wywala komunikat:

Nazwa pear nie jest rozpoznawalna jako polecenie wewnętrzne lub zewnętrzne, program wykonywalny lub plik wsadowy.

No i nie wiem jak to ugryźć, będę wdzięczny za jakieś wskazówki, dodam że poprawnie wrzucił mi do rejestru i konsole zrestartowałem, ale nic to nie dało :( (

Dodaj ręcznie ścieżkę PEARa do zmiennej PATH tak jak robiłeś

Krzysztof Karolczak | Friday July 3rd, 2009

Dodaj ręcznie ścieżkę PEARa do zmiennej PATH tak jak robiłeś to krok wcześniej z PHP.

Bardzo przydał mi się ten artykuł tym bardziej że mało

pozycjoner | Monday July 13th, 2009

Bardzo przydał mi się ten artykuł tym bardziej że mało info o symfony pod windows jest

Bardzo przydatny tutor - dzieki :) Wydaje mi sie, ze

sikorka | Saturday August 1st, 2009

Bardzo przydatny tutor – dzieki :)

Wydaje mi sie, ze mogl Ci sie wkrasc blad:
zamiast
;extension:php_xsl.dll
zdaje sie ze powinno byc
;extension:ext/php_xsl.dll
w C:\wamp\bin\php\php5.2.8\php.ini
dlatego, ze php_xsl.dll domyslnie laduje w katalogu C:\wamp\bin\php\php5.2.8\ext

Jesli wszystkim dziala bez tego to dobrze, moze to nie potrzebne.

you are great. this is very helpful document. thank you

seren | Wednesday August 5th, 2009

you are great. this is very helpful document. thank you very much.

thanks, very useful and simple

mahi | Wednesday August 19th, 2009

thanks, very useful and simple

Hej Wielkie dzieki Kiedy odpalam plik go-pear.bat

Maciek | Thursday August 20th, 2009

Hej Wielkie dzieki

Kiedy odpalam plik go-pear.bat dostaje komunikat ( co z tym fantem zrobić ? ) :

har “C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar” does not have a signature
Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: invalid url or non-existent phar “phar://go-pear.phar/index.php” in C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar on line 1236
Aby kontynuowa†, naci˜nij dowolny klawisz . . .

@Maciek Miałam podobny problem jak Ty... spróbuj zainstalować wamp2.0 w innej

b45k4 | Saturday August 29th, 2009

@Maciek
Miałam podobny problem jak Ty… spróbuj zainstalować wamp2.0 w innej wersji np wamp2.0f, bo zakładam że masz wersję wamp2.0i… u mnie dla wersji 2.0f wszystko działało tak jak w tutorialu, a dla wersji 2.0i wyskakiwał ten błąd.

Aby rozwiązać problem z instalacja pear otwieramy konsole wpisujemy: cd C:\wamp\bin\php\php5.3.0> php

Pawel Kopeć | Saturday August 29th, 2009

Aby rozwiązać problem z instalacja pear otwieramy konsole wpisujemy:
cd C:\wamp\bin\php\php5.3.0>
php -d phar.require_hash=0 ./PEAR/go-pear.phar
Powodzenia!

Po utworzeniu projektu, gdy robie podgląd na localhoscie wyświetla si

Piotrek | Monday September 7th, 2009

Po utworzeniu projektu, gdy robie podgląd na localhoscie wyświetla si eekran Symfony Project Created ale bez grafiki. Czy ktoś wie jak to naprawić? Z góry dzięki za pomoc.

[...] http://www.poetryofprogramming.com/pl/symfony/install-symfony-framework-xp-vista-wamp/ [...]

Symfony pod WIN XP « strony www – skrypty i porady | Monday November 30th, 2009

[...] http://www.poetryofprogramming.com/symfony/install-symfony-framework-xp-vista-wamp/ [...]

Hi, I've done all the steps of this tutorial, but when

Symfnoob | Sunday December 6th, 2009

Hi,

I’ve done all the steps of this tutorial, but when I want create a new project I have the message below :


C:\wamp\www\myproject>symfony init-task myproject

Task "init-task" is not defined.

Can anyone help me ?

быстрая диета ларисы долиной,кефирная диета отзывы,легкая и эффективная диета,диета для

moceerftsujnilid | Friday January 8th, 2010

быстрая диета ларисы долиной,кефирная диета отзывы,легкая и эффективная диета,диета для похудения мужчин,диета кима протасова меню,диета кима протасова форум,самые легкие и эффективные диеты,как похудеть быстро в ногах,как избавиться от целлюлита навсегда,девятидневная диета маргариты королевой,21 дневная кефирная диета,диета протасова описание,диета кима протасова отзывы,диета протасова соль,самые эффективные диеты форум,выход из диеты кима протасова,диета протасова запор,наиболее эффективные диеты,эффективные диеты для похудения отзывы,диета похудеть за 3 недели,кондрашов диета доктора борменталя скачать,полосатая кефирная диета отзывы,скачать реферат диета,диета кира протасова,диета долиной отзывы,диета протасова не худею,быстро похудеть на 5 кг,средства для похудания,минусы диеты протасова,как избавиться от целлюлита народные,рисовая бессолевая диета,диета для похудения кормящих мам,диета мочевая кислота в крови,гречневая диета доктора ласкина,диета для похудения при гастрите,быстрая белковая диета,диеты с сахаром в крови,похудеть быстро и навсегда,комплекс упражнений йоги для похудения,самая быстрая диета для похудения,физические упражнения для похудения,советы как похудеть за неделю,быстрый и эффективный способ похудеть,блюда диета протасова,нарушила диету протасова,сколько сидеть на кефирной диете,комплекс упражнений для похудания,диета протасова отзывы результаты,волков диета по крови,кефирная быстрая диета

thank you for this guide. It works for win7 too.

Claudio | Saturday January 23rd, 2010

thank you for this guide. It works for win7 too. good luck!

greetings from Chile!

Цены на генераторы марки АД - ад 30. Цены на

Scegreearrimi | Wednesday June 30th, 2010

Цены на генераторы марки АД – ад 30. Цены на генераторы марки АД.

http://www.messy-comics.com/index.html?id=delec - lesbian comics hentai comic

unavyfrurry | Wednesday July 21st, 2010

http://www.messy-comics.com/index.html?id=delec – lesbian comics
hentai comic

Sex Chatroulette about the grille Sex Chatroulette may be

Tunteelup | Friday July 23rd, 2010

Sex Chatroulette about the grille Sex Chatroulette may be the most latest craze. In this hugely simplistic format, a alcohol can click by means of a cycle of webcam illustrations or photos in an seek to associate Lesbian Chatroulette supervisor near the mesh-work with an fascinating real-live suggestive lesbian pussy. The discussion starts which has a ordinary “Hi”, or some perchance bizarre equivalent.

Install Symfony post for thanx.

chip | Sunday July 25th, 2010

Install Symfony post for thanx.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">



Language

  • English
  • Polski

Navigation

  • css
  • PHP
  • Symfony
    • Installation

Blogroll

  • Symfony

Tags

css (1) eclipse (1) framework (2) PDT (1) PHP (5) Symfony 1.0 (4) Symfony 1.1 (3) Symfony 1.2 (3) tips (2) vhost (1)
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox