Symfony Installation

To install Symfony (I.e PHP Framework) on WINDOWS platform , just follow  step by step.

STEP 1 :-  Install WAMP

Using WAMP we’ll install PEAR and Symfony right afterwards, but starting from the beginning:

WampServer is a Windows web development environment. It allows you to create web applications with Apache, PHP and the MySQL database. It also comes with PHPMyAdmin and SQLiteManager to easily manage your databases.

Wamp Download link :

http://www.wampserver.com/en/download.php

Now double click to Wamp server icon to start it .

STEP 2 :- Activate Apache -> rewrite module

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

STEP 3 :- Enable php_xsl extension

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

STEP 4 :- Environment setting

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

STEP 5:- PEAR Install

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

STEP 6 :- Finally 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.

STEP 7 :- Your first Symfony project

Considering everything went smooth you can now write in the command line:

> cd C:\wamp\www
> mkdir symfony_project
> cd symfony_project
> symfony init-project symfony_project
> symfony init-app symfony_project

Congratulations! The effects of your work can be seen at http://localhost/symfony_project/web/




If you see no image in this page ,

goto

C:\wamp\bin\php\php5.2.6\data\symfony\web\sf

copy sf folder and paste to

C:\wamp\www\symfony_project\web\sf

if sf folder is not there,create sf folder and paste all content in it .

refresh Browser , you will see

61 Responses

  1. Hello,

    I have successfully complete steps up to 6th steps and finally while i am going to make project then i got the error like, ‘symfony’ is not recognized as internal or external command, operable program or batch file.

    my php version : php5.2.6
    my sql version : mysql5.0.51b

    Can you help me for this?

    Regards,
    Dattesh

  2. HI dattesh,
    please check whether you have symfony folder inside php5.2.6/PEAR or not
    c:/wamp/bin/php/php5.2.6/PEAR/symfony

    and inside this path
    c:/wamp/bin/php/php5.2.6
    you must have symfony batch file .
    If it is there then open your CLI and type symfony .

    thanks

  3. hey i followed all of these instructions without errors, but when i browse to http://localhost/symfony_project/web/ i just get a blank page.

    i then tried your instructions for copying the sf directories around, but that didnt change anything.

    i tried clearing all cookies and caches.

    using php 5.2.6

    thanks.

  4. additional…

    one thing of note is that if i try to go to the phpmyadmin or sqlitemanager pages from the wamp menu i get errors.. do you think that could have something to do with it ?

  5. Thanks very much to publish such helping contents..

  6. Hello,

    i have to work on site which is in symfony. so i have to work on it’s some functions . i downloaded it from FTP. but it’s not working fine on my wamp localhost . it display blank page.
    what to do ?
    Can you help me for this?

    Regards,
    php developer

    • Better u install symfony from pear package only .
      I also tried several ways but it doesnot worked out .

      or do one thing , u just download sandbox symfony package and extract it in webroot , for WAMP server , extract that sandbox
      package in wamp/www/ and run http://localhost/sandbox_symfony(name of extracted folder)/web in browser .

      Hope it wil work for u 🙂
      Anand
      PHP developer

  7. Hi

    Really good tutorial I’d been struggeling to get symfony up and running on wamp for a while now and this has sorted most if not all my problems many thanks

    Andrew

  8. Tnx usefull

  9. Excellent! Sweet and simple. Why can’t the poeple over at the Symfony website put a simple tut up like this? Awsome!

    Thank you very much

  10. Thanks for the information.

    Really nice

  11. thanks man, wonderful help

  12. C:\wamp\bin\php\php5.2.6\data\symfony\web\sf

    should be

    C:\wamp\bin\php\php5.2.6\PEAR\data\symfony\web\sf

  13. Hey Andy
    Gr8 tutorial dude!!

  14. Hey,
    gr8 tutorial dude, only one problem i have is after all is said and done…. i noticed that my site was not showing because there is no index.php in the /web/ dircetory.

    should i attempt to start the process over or?????

    • ok problem solved after looking at the tutotial
      i missed 1 critical step
      “symfony init-app symfony_project”

      still stand by it…Gr8 Tutorial!!!!!!!!!!!!!!

  15. I have installed symfony as per instruction and its successfully completed. but now when i try to open the page in browser, a blank page is coming..also simply typing http://localhost is not running now..

    Please help me out

  16. Hi, i was able to get to step 7 but when i entered the command
    symfony init-project symfony_project i got this error “Task “init-project” is not defined.” Please what do i do

  17. Hi
    I have finished up step 6 and create a folder in www but when i try to run the commadn ‘symfony init-project symfony_project ‘ , it shows that ‘init-project is not defined’. what is the problem…….plz anybody give me the solutin………

  18. whenever i type ‘symfony init-app symfony_project’, it says
    ‘Task “init-project” is not defined.’
    how to solve this issue?

    • I used symfony generate:project symfony_project and that appeared to work. Also I had to use symfony generate:app symfony_project for the next step too. Hope this helps.

  19. Thx, great tutotial.

  20. Good day,
    my name is Dee and I am a Childrens party Executive coordinator.
    I see this all the time, really a lot of fathers encounter somewhat a problem, finding the suited Idea for their next Event program!
    Well, how about Mini Crayon 3 in 1 Combo to help it become a real hit?

    Look at Party Rentals NJ! You can book Mini Crayon 3 in 1 Combo for nice prices!

    Have a good time at your next Childrens party, Dee

    Party Rentals NJ

  21. hello…

    In last step its giving me an error “Task init-project is not defined”

    let me know how can i solve this…..

  22. task “init-project” was used for the old version (1.2)
    In version 1.4, should use “generate:project ” instead of “init-project”

  23. gr8 tutorial thanks man

    though i got error on the following two commands:

    symfony init-project symfony_project
    symfony init-app symfony_project

    that “init-project” & “init-app” are not defined, So I replaced these two commands with

    symfony generate:project symfony_project
    symfony generate:app symfony_project

    And it worked fine for me

    Thanks

  24. Symfony PHP Framwework install post for thanx.

  25. hi
    i m new in Symfony
    i got an error in file …. like phar “C:\wamp\www\php\php5.3.0\PEAR\go-pear.phar” does not have a signaturePHP Warning: require_once: failed to open stream: phar error: invalid url or non-existent phar

  26. Hi,

    I have successfully complete steps up to 6th steps and finally while i am going to make project then i got the error like, ‘symfony’ is not recognized as internal or external command, operable program or batch file.

    my php version : php5.3.0
    my sql version : mysql5.1.36

    help me please

  27. Followed everything up to the part in step 6: then followed the comments from ALINAWAZ, on July 21, 2010 at 8:49 pm, then followed Anand’s main comments again around not being able to see the images. All worked well, although I did have to trawl around environment variables.

  28. Hi anand i want to install symphony on windows + xampp the above steps not working properly. I have reach till create pear no more things to go proper.

  29. init-project is changed to generate:project and
    init-app is generate:app

  30. Hello,
    After ‘symfony init project symfony_dragan’,
    Output was “Task ‘init-project’ is not defined’…
    Can you help me?
    Thanks in advance!

  31. OK, I saw response above!!!
    Thanks anyway!!!

  32. I did all those but i am still not getting tht Symfony page on my browser..
    what to do..?

  33. Awesome tutorials. keep it up…….

  34. Basically, the command to add PEAR to php is not implemented properly. Even the work around that is suggested in the WAMPserver forum is not enough to enable symfony/symfony to be installed via PEAR. To be able to use symfony with it was one of the main reasons for downloading WAMP. Otherwise a charming product but with a broken implementation of PEAR. Any progress on fixing it?

  35. I have successfully complete steps up to 6th steps and finally while i am going to make project then i got the error like, ‘symfony’ is not recognized as internal or external command, operable program or batch file.
    i checked symfony folder inside php5.2.6/PEAR is there in D:/wamp/bin/php/php5.2.6/PEAR/symfony
    and inside this path
    D:/wamp/bin/php/php5.2.6, symfony batch file also there.please let me know where can i create a project folder inside D:/wamp/bin/php/php5.2.6 or D;/wamp/www/ please guide me how to solve this issue

  36. I couldn’t get it to work with wamp and win 7 for some reason. But i followed this tutorial and got it to work with xampp Also xampp already comes packaged with Pear you just to do a upgrade and continue on.

    Good tutorial.

  37. i am getting error
    Could not open file: c:\wamp\www\system32\\symfony
    when i give this command
    > symfony init-project symfony_project

    please help!!!

  38. Hey buddy, you are so champ. It worked fine following each step. Just 1 correction. I guess most of us would be using symfony 1.4.9, it has new commands. Instead of init-project and init-app, not they have generate:project and generate:app commands. I am adding them here just to make others experience easier. Thank you all for your various works and comments. Cheers. Ankit

  39. Perfect !
    thks
    Yaz

  40. phar “C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar” does not have a signaturePHP W
    arning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
    r 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

    Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
    r 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
    Press any key to continue . . .

    I’m getting this error, in 5 step..
    help me

    • hi,
      i’ve installed the pear package through cmd prompt

      E:\wamp\bin\php\php5.3.0>php -d phar.require_hash=0 PEAR/go-pear.phar

      Are you installing a system-wide PEAR or a local copy?
      (system|local) [system] : local
      Please confirm local copy by typing ‘yes’ : yes

      Pear install succeed.
      (system|local) [system] : local
      Please confirm local copy by typing ‘yes’ : yes

      Create a symfony project

      E:\wamp\www\mysymfony>symfony generate:project mysymfony

      E:\wamp\www\mysymfony>symfony generate:project mysymfony

      go to check the link
      http://localhost/mysymfony/web/

  41. […] php framework’ü kurdum. Kurulum sırasında hiç sorunla karşılaşmak istemezdim ancak bulabildiğim en iyi kurulum talimatı bir kaç sene eski olunca yine iş başa düştü. Neyse önce şu symfony nedir ne değildir bi […]

  42. Hi,
    let me know how can we configure database.

    can you help me/
    Thanks in advance

  43. Hi,
    Great tutorial thanks,let me know how can we configure our database

    can you help?
    thanks in advance

  44. Hi,
    I’m new to symphony &Thanks for Ur tutorial.It was great i installed symfony on windows successfully but i need how can we configure database.Let me know how we configure database?.

    Thanks in advance

  45. In step 7 symfony init-project symfony_project

    i have a error like, ‘symfony’ is not rec as an internal or external command,

    please any one help what wrong i did, how u correct this error…

  46. Hi,
    In step 7 i have a error that, the symfony is not a recognized or not a patch file. what wrong i did, anyone help me

  47. tnx alot

  48. My go-pear.bat did not run after Step 4 but I went head with: C:\>php wamp\www\sfproject\lib\vendor\symfony\data\bin\symfony generate:project PROJECT_NAME and I got it. Huray thaks dude

  49. Everything wrote was actually very reasonable.
    But, what about this? suppose you were to write a awesome title?
    I mean, I don’t want to tell you how to run your blog, but what if you added a title that grabbed a person’s attention?
    I mean Symfony Installation | — Welcome To Anand Sharma World — is a little boring.

    You ought to peek at Yahoo’s front page and watch how they write article titles to get viewers interested. You might try adding a video or a picture or two to grab readers excited about everything’ve written.
    Just my opinion, it could make your posts a little
    livelier.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: