Setting up Symfony Project on windows

Setting up Symfony Project on windows

Hi guise i Have share my experience to you when What i have got when setting up symfony project on my computer.

I have share the steps require to install symfony project.

I have created the project folder name pkb and url : pkb.localhost

Step 1: At first we need to create development environment
[Which is located in C:\WINDOWS/system32/drivers/etc/hosts ] Open this file and add the virtual host mapping with localhost ip.
#hosts file pkb.localhost
# add the localhost ip( with virtual domain (pkb.localhost). [pkb.localhost] is virtual host now

Step 2:
Need to add the virtual host mapping with project name.
Which is located into Wamp server [Apache/ httpd.conf].
Local location where the wamp version 2.2 have installed into D:
So the absolute location : D:\wamp\bin\apache\apache2.2.22\conf\httpd.conf
Edit File (and add the virtual host mapping with project)
# httpd.conf

ServerName pkb.localhost
DocumentRoot “D:\development\sfprojects\pkb\web”
DirectoryIndex index.php
<Directory “D:\development\sfprojects\pkb\web”>
AllowOverride All
Allow from All

Alias /sf D:\development\sfprojects\pkb\lib\vendor\symfony\data\web\sf
<Directory “D:\development\sfprojects\pkb\lib\vendor\symfony\data\web\sf”>
AllowOverride All
Allow from All
Step 3:
Create project folder with {Drive or D:/}development/sfproject/{project_name}/lib/vendor
Now in this example:
(Create below folder structure)

After creating folder structure for symphony project installation we need the symphony version and place this symphony version folder content with making sure of folder name symphony.
For download latest stable version of Symfony. Go through this link
Now we find the symphony project [we have multiple files and folders in symphony downloaded folder.] D:\development\sfprojects\pkb\lib\vendor\symfony\

[Put the downloaded symfony project under vendor folder]


Step 4:
After putting symphony project into lib/version
We need to help from command line for generating default project files and folder.
Go to project installed folder by command line.
Run >> cmd
Go to place of project root folder {pkb} for this example.
\data\bin\symfony generate:project test –orm=Propel


[It generates the project default file and folder structure.] Step 5:
For generate the application the application have modules,configuration,libraryfiles and template files.
Below syntax creates the frontend application with its folder structure.
D:\Development\sfprojects\pkb>php symfony generate:app frontend


Step 6:(Database Connection)
Create database from the php myadmin connect it from the application.
[below is the connection of database pkb_symfony with mysql user name root with blank password(If we have password of mysql we need to put it after root with space like root password )] D:\Development\sfprojects\pkb>php symfony configure:database “mysql:host=localhost;
dbname=pkb_symfony” root
(It creates the connection file of database pkb_symfony with symphony project it is located in
D:\development\sfprojects\pkb\config\databases.yml File)

Step 7: (Generating schema,model and forms)
Symfony generates all the schema file [The yml file which have all table structure and data types of this database with yml structure.], model [The connection between the controller(action) database query supportive function will automatically generated. ] and forms (all the default forms which helps to generate form of the table.) file.
We need to run the command to generate these all
Schema Files
Model Files
And Forms file
Command >

1. D:\development\sfprojects\pkb>php symfony propel:build-schema

2. D:\Development\sfprojects\pkb>php symfony propel:build-model
3. D:\Development\sfprojects\pkb>php symfony propel:build-froms


Download Word File

Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment