Kook James avatar

Symfony Tutorial: How to Install Symfony Framework on Your Machine

kookjames

Published: 28 Mar 2018 › Updated: 28 Mar 2018Symfony Tutorial: How to Install Symfony Framework on Your Machine

Symfony Tutorial: How to Install Symfony Framework on Your Machine

symfony.png
Image URL

What Will I Learn?

  • Which command using for Symfony installing

  • How create First Symfony Application

  • Composer-based Installation

  • How can run the application

Requirements

  • WAMP (Windows)

  • LAMP (Linux)

  • XAMP (Multi-platform)

  • MAMP (Macintosh)

  • Nginx (Multi-platform)

  • Microsoft IIS (Windows)

  • PHP built-in development web server (Multi-platform)

  • Operating System: Cross-platform

  • Browser Support: IE (Internet Explorer 8+), Firefox, Google Chrome, Safari, Opera

  • PHP Compatibility: PHP 5.4 or later. To get the maximum benefit, use the latest version.

Difficulty

  • Basic

Tutorial Contents

In This Tutorial we will explain how to install Symfony structure on your machine. Symfony framework installation is exceptionally basic and simple. You have two strategies to make applications in Symfony system. The first strategie is utilizing Symfony Installer, an application to make a task in Symfony structure. Second strategy is arranger based establishment. How about we experience every one of the strategies one by one in detail in the accompanying areas.

Which command using for Symfony installing

Symfony Installer is utilized to make web applications in Symfony structure. Presently, how about we design the Symfony installer utilizing the following command.

$ sudo mkdir -p /usr/local/bin 
$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony 
$ sudo chmod a+x /usr/local/bin/symfony

After using this command now, you have installed Symfony installer on your machine.

How create First Symfony Application

Following Syntax is utilized to make a Symfony application in the most recent variant.

Syntax

symfony new app_name

Here, app_name is your new application name. You can specify any name you want.

Example

symfony new HelloWorld

In the wake of executing the above command, you will see the following reaction.

Downloading Symfony...

0 B/5.5 MiB   
  
   
Preparing project...  
  Symfony 3.2.7 was successfully installed. Now you can:  
   * Change your current directory to /Users/../workspace/firstapp  
   * Configure your application in app/config/parameters.yml file.  
   * Run your application: 
      1. Execute the php bin/console server:run command. 
      2. Browse to the http://localhost:8000 URL.  
   * Read the documentation at http://symfony.com/doc 

This command makes another directory called "firstapp/" that contains an unfilled task of Symfony system most recent adaptatio

Install Specific Version

If you want to install a specific Symfony version, then you need to use the following command.

symfony new app_name 2.8 
symfony new app_name 3.1

Composer-based Installation

You can make Symfony applications utilizing the Composer. Ideally, you have installed the composer on your machine. In the event that the composer isn't installed, download and install it.
The following command is used to create a project using the composer.

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

If you want to specify a specific version, then you can use the above command to specify it.

How can run the application

Move to the project directory and run the application using the following command.

cd HelloWorld 
php bin/console server:run 

After using the above command, open your browser and request the url http://localhost:8000/. It will create the following result.

Result

kkkkk.jpg



Posted on Utopian.io - Rewarding Open Source Contributors

Leave Symfony Tutorial: How to Install Symfony Framework on Your Machine to:

Written by

Read more #utopian-io posts


Best Posts From Kook James

We have not curated any of kookjames's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Kook James