Page 1 of 1

PHP pages display well on webhost, but not on my localhost

Posted: Sat Sep 26, 2009 7:50 am
by grantp22
Hi can somebody please advise me on what the problem is with my php installation, it is installed on Win XP Pro using IIS 5.1, PHP Version 5.2.3 with MySql 5.0.15. IIS is configured with ISAPI filter set to "C:\PHP\php5isapi.dll" and is loaded, mappings is set to ".php" with executable set as "C:\PHP\php5isapi.dll".

I am sure it has to do with my php.ini file, but I am a first time php user and I have searched all over the web and can't find any reason for this happening - this is what displays on my localhost, this is a screenshot of the portion of the affected page:

Image

This is what is displayed on my webhost (http://www.000webhost.com) of the same portion of the page, the script does not appear on the page, and it displays perfectly, so it is definitely not my code!

Image

Here is a link to my PHP settings (http://www.fileden.com/files/2008/3/12/ ... Config.rtf)

And here is a link to my php.ini file (http://www.fileden.com/files/2008/3/12/1810634/php.ini), can somebody please advise me on what could be the cause of the script showing up all over my php pages, this is driving me nuts, I can't do proper testing without having to edit live on my webhost which is time consuming...

Or could this possibly be due to something other than my php configuration because it can't be the code! :idea:

Many thanks
Grant

Re: PHP pages display well on webhost, but not on my localhost

Posted: Sat Sep 26, 2009 8:24 am
by Darhazer
Are you sure that this is the loaded configuration file?
It seems like short_open_tag is off, and you are using it. Can you check via phpinfo() what is the value for short_open_tag ?

Re: PHP pages display well on webhost, but not on my localhost

Posted: Sat Sep 26, 2009 9:35 am
by grantp22
Hi

My php configuration shows that short_open_tag = on for local and master!

Re: PHP pages display well on webhost, but not on my localhost

Posted: Sat Sep 26, 2009 9:44 am
by grantp22
This was the first thing I suspected and checked (short_open_tag ), I even went so far as to edit the script using <?php, but all that did was output everything (script, html the works)to the browser no elements were created, just plain old text... This has me confused!!

Re: PHP pages display well on webhost, but not on my localhost

Posted: Sat Sep 26, 2009 9:46 am
by Darhazer
It is parsed at all?
Does the script:

Code: Select all

<?php phpinfo(); ?>
works or it's just display the code?
If it display the code, the problem is with the web-server configuration, which does not pass the script to PHP at all... you have to setup a handler for the .php extension.

Re: PHP pages display well on webhost, but not on my localhost

Posted: Mon Sep 28, 2009 8:02 am
by grantp22
Grant here, yes php is being parsed! I have tried with <?php phpinfo(); ?> and with <? phpinfo(); ?> and they both work fine, I get the php configuration form! I agree this should work on localhost, but it doesn't, it works perfectly on my webhost though! Very weird!!!