Home > Article > Backend Development > Symfony installation and configuration method, symfony configuration method_PHP tutorial
The examples in this article describe the installation and configuration method of Symfony. Share it with everyone for your reference, the details are as follows:
Installing Symfony manually is very simple and there is hardly much to say. Open http://symfony.com/download, select a Symfony release version from the selection list on the page, and then click "DOWNLOAD NOW" next to it to unzip the downloaded file package to a location on your Web server , the installation is complete. (Choosing the one with the highest version number is usually the best. Whether in tgz format or zip format is just a matter of personal preference. Each version of Symfony also has a "without vendor" version, but it is best not to download this version at the beginning.)
Install Symfony using Composer
Symfony has a good partner called Composer. Let’s see how to use Composer to install Symfony.
Get Composer
As mentioned before, Composer is a PHAR, an executable PHP code package (Php ARchive), which is a cool thing. If you are interested, there is more about Composer at https://getcomposer.org/ for more information.
On *nix systems, you can run the following command to automatically install Composer:
curl -sS https://getcomposer.org/installer | php
Composer’s installation program will do some checks on the system environment and give some suggestions for configuration modifications. Try to follow its prompts when possible. Once 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
/path/to/webroot/Symfony in the above command is the path you want Symfony to be installed to, and 2.3.1 is the version number. When you read this article, this number is probably not the latest Symfony version. You can go to http://symfony.com/download to get the latest version number and replace it with it.
Whether you install it manually or use Composer, you can finally see the file structure of the project in the installation directory you selected.
If you are using Apache's web server, and assuming that Symfony is located in the Symfony directory in the root directory, you can use the following URL to see the successful installation of Symfony.
http://localhost/Symfony/web/app_dev.php
If you use Nginx, more configuration work may be required, which will be further introduced in subsequent articles.
Readers who are interested in more PHP-related content can check out the special topics of this site: "Summary of PHP office document operation skills (including word, excel, access, ppt)", "Summary of PHP date and time usage", "php-oriented "Introduction Tutorial on Object Programming", "Summary of PHP String Usage", "Introduction Tutorial on PHP MySQL Database Operation" and "Summary of Common PHP Database Operation Skills"
I hope this article will be helpful to everyone in PHP programming.