Read the updated version of this page for Symfony 5. The goal of this chapter is to get you up and running with a working application built on top of Symfony. Fortunately, Symfony offers "distributions", which are functional Symfony "starter" projects that you can download and begin developing in immediately.
If you're looking for instructions on how best to create a new project and store it via source control, see Using Source Control. For more information on Symfony2 requirements, see the requirements reference. Symfony2 packages "distributions", which are fully-functional applications that include the Symfony2 core libraries, a selection of useful bundles, a sensible directory structure and some default configuration.
When you download a Symfony2 distribution, you're downloading a functional application skeleton that can be used immediately to begin developing your application. On this page, you'll see the Symfony Standard Edition , which is the main Symfony2 distribution.
Here, you'll need to make two choices:. Download one of the archives somewhere under your local web server's root directory and unpack it. From a UNIX command line, this can be done with one of the following commands replacing with your actual filename :. The check:security command terminates with a non-zero exit code if any of your dependencies is affected by a known security vulnerability.
This way you can add it to your project build process and your continuous integration workflows to make them fail when there are vulnerabilities. According to the Symfony release process , "long-term support" or LTS for short versions are published every two years.
Check out the Symfony releases to know which is the latest LTS version. By default, the command that creates new Symfony applications uses the latest stable version. If you want to use an LTS version, add the --version option:. The lts and next shortcuts are only available when using Symfony to create new projects.
If you use Composer, you need to tell the exact version:. The Symfony Demo Application is a fully-functional application that shows the recommended way to develop Symfony applications. It's a great learning tool for Symfony newcomers and its code contains tons of comments and helpful notes. With setup behind you, it's time to Create your first page in Symfony. Learn More. For example, PHP 8. Install Composer , which is used to install PHP packages.
Note The Symfony binary is developed internally at Symfony. Setting up an Existing Symfony Project In addition to creating new Symfony projects, you will also work on projects already created by other developers. Running Symfony Applications In production, you should install a webserver like Nginx or Apache and configure it to run Symfony. The best Symfony learning resource and the reference to develop applications following the official best practices. Receive an email when a new Symfony version is published or when a Symfony version reaches its end of life.
If you prefer, you can download the binaries directly from GitHub: bit or bit platforms. If you prefer, you can download the binary directly from GitHub. PHP's internal web server is great for developing, but should not be used on production. Instead, use Apache or Nginx. See Configuring a Web Server. The Symfony Installer checks if your system is ready to run Symfony applications. For that reason, Symfony provides a visual configuration checker. Access the following URL to check your configuration and fix any issue before moving on:.
If you have any file permission errors or see a white screen, then read Setting up or Fixing File Permissions for more information. At this point, you've created a fully-functional Symfony application! Updating those libraries frequently is a good practice to prevent bugs and security vulnerabilities. Execute the update Composer command to update them all at once this can take up to several minutes to complete depending on the complexity of your project :. Symfony provides a command to check whether your project's dependencies contain any known security vulnerability:.
A good security practice is to execute this command regularly to be able to update or replace compromised dependencies as soon as possible. You've already downloaded the Symfony Standard Edition : the default starting project for all Symfony apps.
You'll use this project throughout the documentation to build your app!
0コメント