これは私を大いに困惑させました。ドメインにアクセスすると、index.php
ファイルがダウンロードされます。domain/index.php にアクセスすると、問題なく動作しています。私はあちこちにコメントしようとしましたが、修正できません。これはZend Framework 3
. 同じサーバーに他のphpサイトがあります。彼らは大丈夫です。今はZF3スペシャルなのかなと思い始めています。
私のnginxは次のようなものです:
server {
listen 80;
server_name xxx.xxx.com;
index index.php index.html;
root /data/www/xxx/public;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /data/www/xxx/public/index.php;
}
access_log logs/worth.jusfeel.cn.log main;
}
他の設定も試しました。それは同じだ。アドレスバーの URL が に変わり..domain/index.php
ますが、ファイルはダウンロードされindex.php
ます。
server {
listen 80;
server_name www.example.com;
root /var/www/www.example.com/myapplication;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}