我用nginx和php 7安裝了debian 8,用zendframework創建一個端點。當我遵循網站時,我必須將這些添加到我在nginx中的虛擬主機配置中。像我一樣看到下面的代碼:ZF3 Nginx服務index.php下載文件
server {
listen 80;
listen [::]:80;
root /var/www/endpoint/html/public;
server_name my_ip;
location/{
index index.php
try_files $uri $uri/ @php;
}
location @php {
# Pass the PHP requests to FastCGI server (php-fpm) on 127.0.0.1:9000
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /var/www/endpoint/html/public/index.php;
include fastcgi_params;
}}
但是,當我瀏覽網頁的下載index.php文件,而不是執行的index.php。
我希望任何人都可以幫我解決這個問題。
位置內的'index'使內部重定向。 – Deadooshka
@Deadooshka你能告訴我該如何解決這個問題嗎?這是來自原始github的信息https://github.com/zendframework/ZendSkeletonApplication – Noob
我不確定你需要那個'index',因爲我無法看到'.php'的正確'位置' – Deadooshka