PHP Not Working - Blank white page?

Discussion in 'PHP' started by asharfivig, Aug 19, 2010.

  1. #1
    I made my website on my laptop (localserver) and it was working fine. But when I uploaded to my hosting account and tried to view it in my browser, all I get is a blank white screen. No errors, no messages. Just blank screen.

    I tried different hosts ... same problem ... but the website runs fine on my localhost. what could be the problem ???

    I even contacted me hosting company and they told me that PHP server is running fine.
     
    asharfivig, Aug 19, 2010 IP
  2. Narrator

    Narrator Active Member

    Messages:
    392
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Try creating a page with just:
    <?php phpinfo(); ?>
    PHP:
    in it and see if it is still a blank page.

    Can you post some of your code or pm me the url so I can take a look.
     
    Narrator, Aug 19, 2010 IP
  3. asharfivig

    asharfivig Peon

    Messages:
    164
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    On top of my file, I have:

    include("/includes/config.php");

    it gives me a blank page but works on my localhost

    but if i do

    include 'includes/config.php';

    then the script runs. why is that?
     
    asharfivig, Aug 19, 2010 IP
  4. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #4
    It's because '/includes/config.php' and 'includes/config.php' are different. The first one is absolute path and the other is relative path.

    The first one means that it will look at the root. The second one means that it will look at the current directory. Try this and it should work:
    
    include("./includes/config.php");
    
    PHP:
    Because './' represents current directory.
     
    Rainulf, Aug 19, 2010 IP