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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
grantp22
Forum Newbie
Posts: 24
Joined: Tue Sep 15, 2009 9:34 pm

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

Post 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
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

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

Post 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 ?
grantp22
Forum Newbie
Posts: 24
Joined: Tue Sep 15, 2009 9:34 pm

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

Post by grantp22 »

Hi

My php configuration shows that short_open_tag = on for local and master!
grantp22
Forum Newbie
Posts: 24
Joined: Tue Sep 15, 2009 9:34 pm

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

Post 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!!
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

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

Post 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.
grantp22
Forum Newbie
Posts: 24
Joined: Tue Sep 15, 2009 9:34 pm

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

Post 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!!!
Post Reply