Nginx download php file instead of executing it






















Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Nginx serves. Asked 7 years, 2 months ago. Active 2 months ago. Viewed k times. Others "location" are commented Improve this question.

Paulo Boaventura 1, 1 1 gold badge 7 7 silver badges 26 26 bronze badges. Apeiron Apeiron 1, 2 2 gold badges 11 11 silver badges 21 21 bronze badges. That's all we can tell you though since you didn't show us any of your config. Thanks Brad — Apeiron. Whichever file or files you put your config in.

The relevant part being Show 4 more comments. Active Oldest Votes. Improve this answer. Jack M. Joy, tried your suggestion but it didn't worked. For php7. Show 10 more comments. I think the restart and incognito mode helped me. Thank a ton for the noobness we can do. Thanks a lot. This made it for me, also after hours trying a lot of other solutions suggested. It was strange to me that my site worked on IE and chrome while in mozilla it downloded the site intead of executing it.

It was mozilla's cache fault. You saved my time bro. Show 1 more comment. If you're using PHP 7. AndrewFox- my filename is php7. M Arfan M Arfan 3, 4 4 gold badges 24 24 silver badges 43 43 bronze badges. I tried this didn't work for me, I'm using ubuntu Add a comment.

So here are my 2 cents, nginx is a web server and not an application server and thus, it can only serve static pages. This is where common gateway interface CGI comes in. It's a piece of software that manages this communication. Nice explainer. DigitalOcean home. Community Control Panel. Hacktoberfest Contribute to Open Source.

Posted July 18, I set cgi. Add a comment. Subscribe Subscribed. I had same issue. Anyone can help us? Tell me what happens. Submit an Answer Submit an answer. Reply Report. Hey Folks, just ran into this myself working with Wordpress. KBagher November 9, If there is no version information about your PHP, then you should install it with: sudo apt update sudo apt install php-fpm.

Viewed 13k times. Ubuntu Improve this question. Jon Jon 1 1 gold badge 1 1 silver badge 2 2 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Thank you! That worked. I was thinking of that file as a catch-all of general settings that should apply to all sites I'll host, then have specific site configs in the relevant files, no?

To the best of my knowledge nginx allows 'global' settings for only some directives. Best practices recommend dedicated server blocks. Even dynamically configured load balancers with service discovery generate full server blocks, based on an nginx template. See: nginx-proxy used with a template generator docker-gen using an nginx template nginx.

If you scan the template you see dedicated server blocks and some 'global' settings — L. Basically anything that is allowed in the http context.



0コメント

  • 1000 / 1000