This article mainly introduces Symfony's installation and configuration methods, and analyzes the specific steps and related skills for installing Symfony using Composer, for more information about Symfony installation and configuration, see the following example. We will share this with you for your reference. The details are as follows:
Installing Symfony manually is simple, and there is almost no need to talk about it. Open the http://symfony.com/download, select a Symfony release from the selection list on the page, and then click download now next to it ", decompress the downloaded package to a location on your Web server. The installation is complete. (The most popular version is usually the best. The tgz format or zip format is just a matter of personal preferences. For each version of Symfony, there is also a "without vendor" version, but it is best not to download this version at the beginner stage .)
Install Symfony using Composer
Symfony has a good partner called Composer. Let's take a look at how to use Composer to install Symfony.
Get Composer
As mentioned above, Composer is a phar php code package (Php ARchive) that can be executed. It is a cool thing. If you are interested in it, https://getcomposer.org/has more information about Composer.
On * nix, run the following command to automatically install Composer:
curl -sS https://getcomposer.org/installer | php
The installation program of Composer checks the system environment and provides some suggestions for configuration modification. If possible, follow the prompts. After everything is ready, you can use Composer to install Symfony. Run the following command:
php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.3.1
In the above command,/path/to/webroot/Symfony is the path to which you want Symfony to be installed, and 2.3.1 is the version number. When you see this article, this number is probably not the latest Symfony version, you can go to the http://symfony.com/download page to get the latest version number, and then replace it with it.
Whether you manually install or use Composer, you can view the file structure of the project in the installation directory you selected.
If you are using an Apache Web server and assume that Symfony is located in the Symfony directory under the root directory, you can use the following URL to see the successful installation of Symfony.
Http: // localhost/Symfony/web/app_dev.php
If Nginx is used, more configuration work may be required, which will be further described in subsequent articles.