phpbrew
을 사용하여 PHP 7.1로 업그레이드하려고 시도했는데 어디서나 Apache보다 간단하다는 것을 알았 기 때문에 nginx를 사용하여 설치하도록 선택했습니다. , 내 소견에).Symfony2, phpbrew, nginx, php 7.1 및 파일을 찾을 수 없습니다.
nginx에서 Symfony2를 실행하려고 시도한 결과 this doc page이 나타났습니다.이 설정은 nginx에서 Sf2의 기본 구성을 제공합니다.
app_dev.php
, 그리고 .php
으로 끝나는 모든 파일을 제공하도록 php-fpm을 구성 할 수있었습니다. 그러나 다른 URL (예 : /home
)으로 가면 nginx 설정이 중단되고 php-fpm
에 File not found
오류가 표시됩니다.
app_dev.php
또는 app.php
이후의 모든 것을 허용하도록 nginx 가상 호스트를 구성하려면 어떻게해야합니까 (apache2에서 modrewrite
과 같이)? 참조
내 nginx를 파일 :
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
server_name localhost;
location/{
try_files $uri $uri/ =404;
}
location /my-app {
index web/app_dev.php;
try_files $uri /web/app.php$is_args$args;
}
location /dist {
root /usr/share/nginx/html;
index depp/index.php;
try_files $uri /depp/index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass unix:/home/gabriel/.phpbrew/php/php-7.1.0/var/run/php-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param REQUEST_URI $uri?$args;
}
}