Find the answer to your Linux question:
Results 1 to 5 of 5
I keep getting a blank screen when I open .php page. I view source and I see all the php <? ?> stuff why isn't it being handled by the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2005
    Posts
    10

    Installed PHP, getting blank screen


    I keep getting a blank screen when I open .php page. I view source and I see all the php <? ?> stuff

    why isn't it being handled by the webserver? I added the Addtype command in httpd.conf as well. What else is there to do?

    I read somewhere that u have to open a .php from ur webserver at first like http://localhost/test.php. Only problem is, I don't know how to do that through linux.

    it works when I type >>php test.php at the prompt. I even get phpinfo() that way.

    advice?

  2. #2
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    What does your httpd.conf looks like?

    Mine looks something like this
    Code:
    // First of all, make sure this line &#40;or similar&#41; is enabled, i.e not commented
    LoadModule php4_module modules/libphp4.so
    
    // Search for this line and change it to this &#40;this is misc, nothing to do with your problem
    DirectoryIndex index.html index.php
    
    // Then add this at the end of the file
    AddType application/x-httpd-php .php
    Quote Originally Posted by Sikh
    I read somewhere that u have to open a .php from you webserver at first like http://localhost/test.php. Only problem is, I don't know how to do that through linux.
    ??? You dont know? Yes you do. Simply put, open a browser and point it to the URL location of the script. You know, you're installing php and a webserver, so, a browser is the way to access the script...
    Now if you dont know, apache by default tries to open files pointed in /usr/local/apache/htdocs, so you copy the script there (e.g test.php) and type in your browser http://localhost/test.php
    You say you can run php from the commandline and works fine, so the problem is with the apache configuration, that is not recognizing .php files properly.

  3. #3
    Just Joined!
    Join Date
    Jul 2005
    Posts
    10
    I'm connected to the linux server through SSH. Is there a built in Linux webbrowser like in windows/IE?

    forexample I can't do http://localhost/test.php from my home right? that'll not mean the same thing

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Okay, you've SSH'd in. What's the IP adress of that box? If it's 1.2.3.4, we'd do:

    http://1.2.3.4/test.php

    Another option would be to launch a web browser from the remote box, assuming that it has one installed. Try the "firefox" and "mozilla" commands. If those don't work, you can always try "lynx", which is a text-based web browser that doesn't display images, but otherwise works fine.

  6. #5
    Just Joined!
    Join Date
    Jul 2005
    Posts
    10
    ok I checked

    I didn't have this line:

    LoadModule php4_module modules/libphp4.so

    problem is, if I add it it gives an error like directory not found. I remember seeing a modules folder when I got RedHat installed and the default apache2 had it.

    I checked for a module folder, the installation has it. but the apache2 folder where httpd.conf is, there's no modules directory.

    any idea, how do I resolve this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •