Home
Support Forums

Why is netlify downloading my PHP page how do I run them instead?

uprightcode

When I made a new tab on my navigation menu called CEO it is a PHP page because of a PHP-only password access system. But when I use it on localhost it opens the PHP page and everything works but when I deploy it and preview it downloads it instead of opening it can someone help me?

I have read this StackOverflow forms - How to run php files on netlify? - Stack Overflow the answer was

A Netlify site is deployed to a CDN and serves up static content and although you can run PHP at the time of a deployment, you cannot execute PHP during a page request.
To submit a form, you can use Netlify Forms or some other serverless forms solution.

But mine is a password-only login form, not an email form so I know there is probably a different way to open it. If this is not solved I have no choice but to switch to a Hoster and domain provider.

That is the only option. You can’t run PHP on Netlify. There’s no way around it.

1 Like

I found a solution I can use ceo on localhost but not on netlify that’s the only way.