PHP files downloading instead of executing

Connected Tutorial
This question is a follow-up to this tutorial:

Hello, I installed NGINX as a reverse proxy for my Apache and when I’m trying to access the web, It starts downloading the index.php file (with no name). I have completely same files as in this tutorial. (Only domain changed). I need help with this.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there @ondrejnovy,

This usually happens due to misconfigured PHP-FPM settings.

Does this also happen if you try to access the Apache service directly on port 8080? For example if you create an info.php file and then access http://your_server_ip:8080/info.php do you get the content PHP info page?

Can you share your Apache Vhost config and the /etc/apache2/mods-enabled/fastcgi.conf file here?

Another thing that I could suggest is also checking your Apache error log:

  1. tail -100 /var/log/apache2/error.log

Also, do you have a .htaccess file inside your document root? If so I could suggest temporary disabling it to test if it is causing the issue for you.

Regards, Bobby