Php Blank page on Load ?

When I try to load my page in any web browser it comes up blank !

Page 1 of 1

12 Replies - 4781 Views - Last Post: 29 May 2008 - 11:58 AM Rate Topic: -----

#1 x-lil-monroe-x  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 16-March 08

Php Blank page on Load ?

Posted 26 May 2008 - 03:04 AM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?php
echo "Hello World";
?>

</body>
</html>




Ive just started in php, and the first prt did the echo command the problem is when I load the page [World icon --> Preview in IExplore/Firefox] is comes up a blank. Ive tried everything i can think of. If you could get back to me ASAP it'd be great. Tx

Is This A Good Question/Topic? 0
  • +

Replies To: Php Blank page on Load ?

#2 joeyadms  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 178
  • Joined: 04-May 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 03:11 AM

What does it look like when you view the source. What I am thinking is your http server is not setup to parse php. The AddTypes are not added.

If it is saved as .html, try changing extension to .php and see if it works, a lot of installers will register .php as a application, but not .html
Was This Post Helpful? 0
  • +
  • -

#3 x-lil-monroe-x  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 16-March 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 05:56 AM

Ok.
Ive tried that. The screen is blank when I view it as Html. When I renamed it and converted it into php.. the 'save file dialog' came up. Asking me to save my File !
Was This Post Helpful? 0
  • +
  • -

#4 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 09:34 AM

that means that PHP is not running on your computer...

as to how to get PHP on the comp, idk, as I use a web server directly...
Was This Post Helpful? 0
  • +
  • -

#5 2457  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 72
  • Joined: 09-April 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 11:09 AM

use WAMP.
It can setup apache, mysql, and php on Yours windows computer.
20 megabytes.
Was This Post Helpful? 0
  • +
  • -

#6 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 03:43 PM

View Post2457, on 26 May, 2008 - 11:09 AM, said:

use WAMP.
It can setup apache, mysql, and php on Yours windows computer.
20 megabytes.


Also, when using WAMP it does not setup short tags by default. if you want to use <? ?> instead of <?php ?> you'll need to turn short_open_tag = 'On' in your php.ini file. Otherwise you'll just run into the same problem you're having now.
Was This Post Helpful? 0
  • +
  • -

#7 x-lil-monroe-x  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 16-March 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 04:16 PM

I use <?php ?> anyway .. Thanks guys the wamp thing shud solve it i have installed PHP before but it didnt work properly, and i was using IIS for a server.. no MYSQL was installed.


--- Still No change =(|

This post has been edited by x-lil-monroe-x: 26 May 2008 - 04:51 PM

Was This Post Helpful? 0
  • +
  • -

#8 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 04:30 PM

View Postx-lil-monroe-x, on 26 May, 2008 - 04:16 PM, said:

I use <?php ?> anyway .. Thanks guys the wamp thing shud solve it i have installed PHP before but it didnt work properly, and i was using IIS for a server.. no MYSQL was installed.


No problems. Most people will use <?php ?>, but you may end up wanting to use <?= ?> to just echo out a variable. In that case you'll need short_open_tag = 'On'. You might want to turn it on just to alleviate future pains. Glad you're getting everything fixed.
Was This Post Helpful? 0
  • +
  • -

#9 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 05:22 PM

i would suggest getting rid of all of the HTML and seeing if it works then.... the PHP statement is correct....
Was This Post Helpful? 0
  • +
  • -

#10 joeyadms  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 178
  • Joined: 04-May 08

Re: Php Blank page on Load ?

Posted 26 May 2008 - 07:10 PM

If it is asking you to download the php file, this means '.php' is not setup correctly in your configuration. If you use apache, add this to your httpd.conf
AddType application/x-httpd-php .php .html



If you are using IIS, then google a guide for installing php on iis, you have to set iis to use the php interpreter for php files.

Also, I find that the Zend Core install is very efficient for dev setups on local machines.

Also a little sample code that can distinguish between php issue vs server issue is the following

Hello <?php echo "World"; ?>



If only hello shows up, its a php issue, if hello world shows up, you have a successful php install.
Was This Post Helpful? 0
  • +
  • -

#11 x-lil-monroe-x  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 16-March 08

Re: Php Blank page on Load ?

Posted 27 May 2008 - 12:56 PM

Its still asking me to download it.. Both ways. So i cant check if youre theory is correct joeyadms
Was This Post Helpful? 0
  • +
  • -

#12 joeyadms  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 178
  • Joined: 04-May 08

Re: Php Blank page on Load ?

Posted 28 May 2008 - 04:31 PM

if it is asking you to download it, either way, it is because of your configuration.

You need to add the the AddType declaration, to have it parse php files, and not treat them as binary.
Was This Post Helpful? 0
  • +
  • -

#13 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Php Blank page on Load ?

Posted 29 May 2008 - 11:58 AM

View Postjoeyadms, on 28 May, 2008 - 04:31 PM, said:

if it is asking you to download it, either way, it is because of your configuration.

You need to add the the AddType declaration, to have it parse php files, and not treat them as binary.


Are you developing on a local server that's just running on your laptop? If you're not worried about security or anything you might want to post your httpd.conf file so we can take a look at it. You might not be declaring the Type properly. It's definitely a server configuration issue though. If you post your httpd.conf file you might as well post your php.ini also so we can make sure the proper extensions are enabled if necessary.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1