linux - ZF3 Nginx Serve index.php As Download File -


i installed debian 8 nginx , php 7 creating endpoint zendframework. when follow website have add these virtual host config in nginx. did see code below:

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 php requests 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;     }} 

but when visit website downloading index.php instead of executing index.php.

i hope can me resolving issue.

i think need replace fastcgi_pass value socket path instead of server address , port.

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 

then restart php7-fpm type command

sudo systemctl restart php7-fpm 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -