Symfony Tutorial: How to Install Symfony Framework on Your Machine

in #utopian-io3 years ago (edited)

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

Sort:  

Hi @kookjames, just to let you know, the tutorials you've referenced in the curriculum aren't about Symfony3 but rather about Symfony4 development. Also, according to utopian.io, tutorials linked under the curriculum header are supposed to be yours:

Place here a list of related tutorials you have already shared on Utopian that make up a Course Curriculum, if applicable.

Best regards!

i did't make any other related tutorials, it is my first tutorials contribution ... so i remove it ? or what i do ?

Since you haven't posted any related tutorials yet, probably the best choice would be to edit your contribution and remote the curriculum section. I myself don't mind if you reference my tutorials, so the choice is all up to you :)

Thanks @piotr42 i remove it.

Your contribution cannot be approved because it does not follow the Utopian Rules.

Submissions containing substantial instruction in ubiquitous functions (Save, Open, Print, etc.) or basic programming concepts (variables, operators, loops, etc.) will be rejected.

Submissions focused on the use of functions that are already well documented in the project documentation will be rejected.

You can contact us on Discord.
[utopian-moderator]

Coin Marketplace

STEEM 1.23
TRX 0.12
JST 0.147
BTC 60251.00
ETH 2152.38
BNB 471.07
SBD 9.17