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
Post a Comment