Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Chrome web browser won't open PHP files on my website only?

Writer Andrew Mclaughlin

I'm hosting a raspberry pi website, and I recently added a php file to it. It's literally called page.php. Anyway, Google Chrome won't open it. I think it's working with other php pages, but not the ones on my website! I also noticed today when I went to log in to a few different sites too (Cloudflare) that it always gave me an error. It always prompts me to download the file. I'm currently on a chromebook. I've tried restarting it and that didn't help. Does anybody know what will? Thanks in advance!

P.S. Any reply to this question would be helpful because I'm on a bit of a deadline (ends next week) and while I don't have too much left to do, I'm still very concerned. Thanks!

1 Answer

PHP files aren't processed by the browser, but by the server. It's a server-side language. You have to configure your server to process PHP files. Once a PHP file is executed it should produce some output (HTML in your case) that will be sent to browser by the server.

Your server doesn't process PHP files, but rather offers them to the browser, which in turn tries to download them because they're not proper web pages. Browsers don't know what PHP is because they're not supposed to - they should never leave the server (unless offering them for download is your intention).

I can't tell you what configuration changes you need because I don't know how your server is set up. Certainly PHP must be installed server-side and configured to handle PHP files.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy