composer-and-symfony

Composer in Windows and Symfony

As defined in Composer site – “Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.” Composer requires PHP 5.3.2+ to run.

Am considering that XAMPP is already installed in your computer as was for my case. The you will need to do the following steps:
1) Follow the following C:\xampp\php (C: or any drive where you have installed the XAMPP). Open php.ini and uncomment following lines if  they are commented:

extension=php_openssl.dll, 
extension=php_curl.dll, 
extension=php_sockets.dll

Find the lines:

extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"

Change to the path with exact path with the drive where you have installed XAMPP. For example if you have installed XAMPP in D:\ drive instead of C:\ you need the path like this:

extension_dir = "D:\xampp\php\ext"
browscap = "D:\xampp\php\extras\browscap.ini"

2) Download the composer for Windows from link (Go through the site getcomposer.org for more information). And then install composer in the same folder where your php.exe file is located. Its mainly C:\xampp\php\php.exe.

You have installed composer in your system. Hurray!!  🙂 You can verify that composer is installed in your system by running this command in your system:

composer -V

You can also see composer definition by following command:

composer about

Both will look something like this:

Composer Version and About Command

In order to update composer anytime you can use the command:

composer selfupdate

composer selfupdate

Now starting a Symfony project with the help of composer:
You will need to run the command with the path where the files will be downloaded:

composer create-project symfony/framework-standard-edition C:\xampp\htdocs\sf_sandbox 2.5.*

‘sf_sandbox’ is the project name.

create symfony project

At end you will be asked few questions. You can answer as per your requirements. It asks whether I will like to download acme demo bundle I have pressed ‘N’, it will ask parameters for config database user, name and password. Answer accordingly and then secret token. Try something you will remember in your local machine:

create symfony project questions

 

 

 

 

 

 

Viola! You have created your first symfony project with the help of composer.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x