Diary of problems and solutions related to web programming, database development and related technologies and platforms.

Step to follow while installing Symfony2

Follow these steps to install Symfony2 on your machine. In case if there is difficulty, follow this installation guideline from youtube

1. a. Download Symfony2 from http://symfony.com/download. Unzip it and paste it to the folder inside www if you are using WAMP. Lets say you put everything inside Symfony2Test.
    b. Run WampServer and browse the Symfony2 Package via localhost and go to Symfony2/web/config.php
    c. There you need to set up things and configure the website.

This step 1 is a test step to make sure that you have set up necessary things to run Symfony.

2. Download GIT for windows (if you are using windows) from http://git-scm.com/download/win. Install this GIT on your machine.

Note: To use GIT properly you need to make sure that there is path defined on Environment Variable. If not add this statement on the PATH variable "C:\wamp\bin\php\php5.5.12".

3. Open GIT Bash and
a. Run the following statement to get install Composer via GIT Bash (command prompt) mode. Composer is a package manager which will later help you to install Symfony2 on your machine at later stage.

curl -sS https://getcomposer.org/installer | php

This installer script will simply check some php.ini settings, warn you if they are set incorrectly, and then download the latest composer.phar in the current directory.

For details about installing the visit this page. When you install composer, it installs the composer path to the system by itself.

b. Run the following command to create Symfony Project on your machine.

The general command to install Composer is:

$ composer create-project symfony/framework-standard-edition path/

In our case, you have to specify the correct path. Let say you want to create a new Symfony project called "Symfony2Project". Then run like this

$ composer create-project symfony/framework-standard-edition C:/wamp/www/Symfony2Project 

4. Creating and storing Symfony project in git. For details, check this link
a. Go to your project folder.
$ cd C:/wamp/www/Symfony2Project

b. Initialize your git repository
$ git init

c. Add all of initial files to git
$ git add .

d. Create an initial commit with your started project
$ git commit -m "Initial commit"

In case if you experience the problem like "git: fatal unable to auto-detect email address" then in that case, run the following statements on GIT Bash
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
With this, you will have fully functional Symfony project which is committed to git. Now you can start developing the project. Side by side you can commit the changes to git repository.

Setting up Project Using Relative Path

The above steps will help you install Symfony2 using absolute path (C:/wamp/www/Symfony2Project). If you want to install Symfony2 using relative path, then amend the steps like this way for following points.

Initially go the current root directory
$ cd C:/wamp/www

3b. Run the following command to create Symfony Project on your machine.

$ composer create-project symfony/framework-standard-edition ./Symfony2Project

No comments :

Post a Comment