Php 如何在CentOS上部署Symfony3应用程序
我仍然无法理解服务器中发生了什么 当我在/public\u html中通过服务器推送代码并希望获得我的应用程序主页时,如下所示: http://www.example.com/web/ 服务器向我显示/web的内容(存在于/web中的文件和目录) 这是在我按照step的命令行在该链接中部署symfony 3之后发生的: 我还是不明白那里发生了什么 任何帮助都将不胜感激 1-)Php 如何在CentOS上部署Symfony3应用程序,php,symfony,deployment,symfony-3.2,Php,Symfony,Deployment,Symfony 3.2,我仍然无法理解服务器中发生了什么 当我在/public\u html中通过服务器推送代码并希望获得我的应用程序主页时,如下所示: http://www.example.com/web/ 服务器向我显示/web的内容(存在于/web中的文件和目录) 这是在我按照step的命令行在该链接中部署symfony 3之后发生的: 我还是不明白那里发生了什么 任何帮助都将不胜感激 1-) yum安装nginx 2-服务nginx启动 3-)将Nginx配置添加到/etc/Nginx/conf.d/proj
yum安装nginx
2-服务nginx启动
3-)将Nginx配置添加到/etc/Nginx/conf.d/project\u name.conf
server{
set $web_host "domain_name";
set $web_root "web_directory";
server_name $web_host;
root $web_root;
location / {
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: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 127.0.0.1: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;
# 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;
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
4-`chmod-R nginx:nginx/var/www/html/project``
5-服务nginx重启
和服务php fpm重启