Question

PHP files downloading instead of executing

  • Posted September 26, 2020
  • PHP
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.

Subscribe
Share

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

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.

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