In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install Symfony2.8 in Linux, which is very detailed and has a certain reference value. Friends who are interested must finish reading it!
Linux installation Symfony2.8 environment description operating system tony@ubuntu:~$ lsb_release-aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 14.04.2 LTSRelease: 14.04Codename: trustySymfonysymfony2.8 installation preparation
All installed using apt-get
PHP5.4
At least have a PHP5.4 environment.
Nginx
Web server is indispensable.
Installation steps
1. Download the official command tool
Sudo curl-LsS https://symfony.com/installer-o / usr/local/bin/symfonysudo chmod aquix / usr/local/bin/symfony
two。 Create a project
When the project is created here, the source code package will be downloaded from the official website. After execution, you can see it in the current directory.
Symfony new symfony2.8 2.8
Here I have created a new project called symfony2.8. The last 2.8 (not in the project name) is to download the source code of the specified symfony2.8 version. If you want to download another version, modify the interface.
3. Detection
After installation, symfony will also do some tests to see if your operating system environment is suitable for running symfony, follow the prompts to install the missing extensions (I installed intl) or modify the configuration of PHP (I changed the time zone), and then execute
Php symfony2.8/bin/symfony_requirements
Check again whether it is passed (the file after php is in the newly created project, my project name is symfony2.8)
Running
Symfony2.8' 's own console (location symfony2.8/bin/console) can temporarily launch a webserver. The default port is 8000. After starting, you can see his welcome page through http://localhost:8000`.
Nginx configuration
The configuration of nginx is also found in its official documentation. Here, copy mine directly, and I am also the official document that you modify directly.
Server {listen 8028; # server_name domain.tld www.domain.tld; root / data/app/symfony2.8/web; location / {# try to serve file directly, fallback to app.php try_files $uri / app.php$is_args$args } # DEV # This rule should only be placed on your development environment # In production, don't include this and don't deploy app_dev.php or config.php location ~ ^ / (app_dev | config)\ .php (/ | $) {fastcgi_pass 127.0.0.1 In production 9000; fastcgi_split_path_info ^ (. +\ .php) (/. *) $; include fastcgi_params # When you are using symlinks to link the document root to the # current version of your application, you should pass the real # application path instead of the path to the symlink to PHP # FPM. # Otherwise, PHP's OPcache may not properly detect changes to # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 # for more information). Fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root;} # PROD location ~ ^ / app\ .php (/ | $) {fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^ (. +\ .php) (/. *) $; include fastcgi_params # When you are using symlinks to link the document root to the # current version of your application, you should pass the real # application path instead of the path to the symlink to PHP # FPM. # Otherwise, PHP's OPcache may not properly detect changes to # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 # for more information). Fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; # Prevents URIs that include the front controller. This will 404: # http://domain.tld/app.php/some-path # Remove the internal directive to allow URIs like this internal;} # return 404 for all other php files not matching the front controller # this prevents access to other php files you don't want to be accessible. Location. Php$ {return 404;} error_log / data/log/nginx/symfony_error.log; access_log / data/log/nginx/symfony_access.log;}
It should be noted that nginx contains a configuration that is suitable for the development environment and a configuration that is suitable for the production environment. When deploying the production landscape, do not mention the configuration of the development environment with you.
Once configured, re-reload nginx. What I am listening to here is port 8028 of the virtual machine. By accessing this port, you can also see the welcome page directly.
The above is all the contents of the article "how to install Symfony2.8 in Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.