Hi, how are you? This time we’re going to talk about Symfony. This is a standardized work environment (PHP framework) used for the development of web applications. Additionally, it is one of the most used in the app development environment. In other words, it is a tool for developers to create applications in PHP. On the other hand, this framework has a large number of templates for developing websites and is widely used in the creation of APIs. One of its main features is that it allows you to create from simple websites to large projects and complex applications. One of its main features is that it allows you to create from simple websites to large projects and complex applications. Well, in this post we will see how to install Symfony on Windows 10.
To be able to develop comfortably in Symfony we must prepare Windows. For this purpose, it is necessary to install the following components.
- PHP version 7.1.3 or higher. If you want to know how to install it, please check this post.
- You must also have Composer installed. Click here to see how to install it.
- You also need Git. If you want simple instructions on how to install it, please check here.
- Finally, to start programming in Symfony you need a good Integrated Development Environment (IDE). There are many options, however, I show you how to install Visual Code Studio.
Enable the PHP-curl extension.
Symfony requires the php-curl extension to work. Most likely the extension is available, but it is disabled in the php.ini file. If so, just remove the; in the extension, as explained here.
The first thing you have to do is go to the official website of the program and download the latest version (5.0.2 at the time of publication).
Then run the file to start the installation. First, select an installation directory.
Then assign the shortcut to the start menu folder.
Then, the assistant adds the program to the environment variable PATH. This is very useful, as it allows you to run Symfony from any console.
Then check the installation options and press Install to begin the process.
Forthwith, the wizard will start downloading the files needed to complete the installation.
Please wait a few moments until the assistant has finished his work.
In the first place, checks if the system meets all the requirements for running Symfony With that in mind, please open the Git Bash and enter the following command:
In this case, you can see that the system meets the requirements for running Symfony. Additionally, it offers a number of suggestions to improve the performance of the program
Creating a project with Symfony
There are two options for creating a new project in Symfony. First, you can build a traditional web application. To do so, run the following command:
symfony new my_project_name --full
Secondly, there is the option to build a microservice, a console application or API. With that in mind, run the following command:
symfony new my_project_name
The only difference between the two commands is the number of required dependencies that are downloaded. In fact, with the FULL variable, all the packages needed to build web applications are installed. Consequently, the installation is larger.
During the process, you have to authorize the access of the program through the Windows firewall.
Testing the project in Symfony.
To be able to run the project, it is necessary to navigate to the installation directory. And then start the server:
cd my-project symfony server:start
Then enter the following in the navigation bar of the browser: http://localhost:8000. If everything has been correct, then you will see Symfony’s initial message.
Ultimately, we have seen how to install Symfony on Windows 10. It can be used as a global application to make any page. In addition, with its template engine, a complete page can be made. It is also widely used to make APIs, which is currently under development. All right, that’s it for now. I hope you’ve learned how to install this wonderful framework. See you later!