0

I have just put up a site on firebase, on it is a form where users can put in their database credentials to access it remotely. The form uses POST to send the details to a php page, and its code looks like this:

<form name="login-form" action="login.php" method="post">
  <input autocomplete="off" name="ip_address" type="text" placeholder="Enter DB IP"/>
  <br/>
  <input autocomplete="off" name="db" type="text" placeholder="Enter DB Name"/>
  <br/>
  <input autocomplete="off" name="username" type="text" placeholder="Enter Username"/>
  <br/> 
  <input name="password" type="password" placeholder="Enter Password"/>
  <br/>
  <input id="login-button" type="submit" value=">"/>
</form>

Using my apache2 web server, this process works fine, and the user is redirected, however when deployed with firebase (firebase deploy --only hosting), the process instead triggers a file download of login.php. Why is this happening? The file structure for the public folder is exactly the same as it is for apache, as is each files content.

Gamaray
  • 51
  • 8
  • This happens when Apache2 has no configured php handler. Make sure php-fpm for example is installed. – Markus Zeller Aug 24 '22 at 15:22
  • I see, as I say apache2 actually works fine, it is firebase that is causing the issue. I did install php-fpm but it had no effect, presumably because the files aren't being stored on my server. – Gamaray Aug 24 '22 at 15:28
  • I don't think that apache2 is ok. Then it would execute the PHP file and deliver its output. `firebase deploy --only hosting` may change the configuration. – Markus Zeller Aug 24 '22 at 15:46
  • Firebase Hosting doesn't support PHP https://stackoverflow.com/a/35524033/284325 – jeromegamez Aug 24 '22 at 19:45
  • Ah, thank you. Well since I'm not willing to rewrite this entire site with nodejs I'll try and find a different hosting platform. – Gamaray Aug 24 '22 at 20:13

0 Answers0