I just get some troubles with my php files. I host my website from my computer and I get an index.html file which link to other php files for my website, in firefox when I go from the index files to php files its working fine but with chrome when I go to the php files links I just get the source of the php file display on the webpage. Why?
1 Answer
Sounds like a problem with the configuration of your webserver. Perhaps you have some server-side code that responds to different browsers in different ways? To confirm, you're accessing your server via http://localhost/...
and not via file:///...
?
[EDIT] If you have configured your domain www.example.com
, could it be that Firefox is redirecting you from example.com
to www.example.com
automatically, whereas Chrome isn't? In other words, could there be different behaviour from your server depending on whether the user accesses via these two different URLs? I think that Firefox may do this redirection automatically if you don't explicitly type the http://
.
-
1Look at the first tab, it says
www.
so it's not file:/// And to say it's a problem with the configuration of his web server doesn't tell him what to do so isn't very useful especially not as any kind of answer. And it assumes it's his web server, which isn't necessarily the case, especially when it'shttp://somedomainotherthanlocalhost
– barlopCommented Jul 17, 2016 at 13:02 -
1
<?php (new line) ?>
Also , I see you're going to awww
address, probably you're not running the web server yourself. You could contact your web provider and ask them if they even support php, and if they say yes, then show them what's going on and ask them what's happening