Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
I am trying to set up an apache server w/ PHP & MySQL. All programs were installed by Fedora 1 during installation. Currently httpd starts on boot along with MySOL. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2004
    Location
    I'd rather be in Hawaii
    Posts
    52

    PHP shows blank pages


    I am trying to set up an apache server w/ PHP & MySQL. All programs were installed by Fedora 1 during installation.

    Currently httpd starts on boot along with MySOL. I have created a phpinfo() page in /var/www/, and have done the chmod 777 so that I can access it. However, the php test file continues to show a blank page in a web browser.

    From everything I have researched it's a server configuration error. I tried to load the module in the httpd.conf file. I tried to add the 'loadmodule php-*' to the file, but apparently it is being loaded from an outside file as I get a "module has already been loaded" error. I have copied the php.ini file to /usr/local/lib as suggested, but to no avail.

    Does anyone have any other suggestions? Any help would be appreciated.

  2. #2
    Just Joined!
    Join Date
    Feb 2005
    Location
    Velden - Netherlands
    Posts
    80
    If you have created a file, let's say testphp.php with the line <? phpinfo() ?>
    and placed it in your /var/www/html/ directory, and your chmod 777 didn't work,
    try to set the GroupID to apache with RWX and try again.

    Be careful te use the write and execute for everyone on php files.

    BTW: php.ini is placed in your /etc/

  3. #3
    Just Joined!
    Join Date
    Feb 2004
    Location
    I'd rather be in Hawaii
    Posts
    52
    Thanks, but that didn't work.
    When I run
    #service httpd status
    I get
    Code:
    httpd &#40;pid 5974 5973 5972 5971 5970 5969 5968 5965 5910&#41; is running...
    And when I run
    #service httpd fullstatus
    I get
    Code:
                                       Not Found
    
       The requested URL /server-status was not found on this server.
    
         ----------------------------------------------------------------------
    
        Apache/2.0.47 &#40;Fedora&#41; Server at localhost Port 80
    Does this mean the server is runnign or is it not found?

    If I type $php phptest.php I get the proper HTML output that I can cut and paste into a text editor, save, and then view with a browser. When I try to view the php page in a browser and view the source I can see the php source, which from what I can tell means the page is not being sent to the server for processing. I know php is working, how do I get the server to recognize the file?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Feb 2005
    Location
    Velden - Netherlands
    Posts
    80
    Did you also put in the httpd.conf the following lines so apache knows what to do with this type of file?

    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps
    and restart apache afterwards

  6. #5
    Just Joined!
    Join Date
    Feb 2004
    Location
    I'd rather be in Hawaii
    Posts
    52
    For some reason Fedora put a php.conf file in the /etc/httpd/conf.d/

    These statements are located in this file, and if they are put into the httpd.conf file, I get
    Code:
    &#91;warn&#93; module php4_module is already loaded, skipping

  7. #6
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Quote Originally Posted by SwimminSasquatch
    For some reason Fedora put a php.conf file in the /etc/httpd/conf.d/

    These statements are located in this file, and if they are put into the httpd.conf file, I get
    Code:
    &#91;warn&#93; module php4_module is already loaded, skipping
    If you're getting this then Apache is supporting PHP. What do you get in the Apache logs when you try to run your page?

  8. #7
    Just Joined!
    Join Date
    Feb 2004
    Location
    I'd rather be in Hawaii
    Posts
    52
    The logs in /etc/httpd/logs contain the following, but the time stamps seem to indicate boot time or server restart times, not actual page access times.

    /etc/httpd/logs/access_log
    Code:
    127.0.0.1 - - &#91;24/May/2005&#58;18&#58;59&#58;29 -0400&#93; "GET /server-status HTTP/1.1" 404 324 "http&#58;//localhost&#58;80/server-status" "ELinks &#40;0.4.2; Linux; &#41;"
    /etc/httpd/logs/error_log
    Code:
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8740 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8741 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8742 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8743 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8744 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8745 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8746 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8747 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8741 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8742 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;00 2005&#93; &#91;warn&#93; child process 8745 still did not exit, sending a SIGTERM
    &#91;Wed May 25 07&#58;14&#58;01 2005&#93; &#91;notice&#93; caught SIGTERM, shutting down
    &#91;Wed May 25 07&#58;14&#58;06 2005&#93; &#91;warn&#93; module php4_module is already loaded, skipping
    &#91;Wed May 25 07&#58;14&#58;06 2005&#93; &#91;notice&#93; Digest&#58; generating secret for digest authentication ...
    &#91;Wed May 25 07&#58;14&#58;06 2005&#93; &#91;notice&#93; Digest&#58; done
    &#91;Wed May 25 07&#58;14&#58;07 2005&#93; &#91;notice&#93; Apache/2.0.47 &#40;Fedora&#41; configured -- resuming normal operations
    /etc/httpd/logs/ssl_error_log
    Code:
    &#91;Wed May 25 07&#58;14&#58;06 2005&#93; &#91;warn&#93; RSA server certificate CommonName &#40;CN&#41; `localhost.localdomain' does NOT match server name!?
    &#91;Wed May 25 07&#58;14&#58;07 2005&#93; &#91;warn&#93; RSA server certificate CommonName &#40;CN&#41; `localhost.localdomain' does NOT match server name!?
    every other log is empty.

    I don't remember changing the file name, but just in case I may have inadvertantly done so, how do I rename the server, and ensure all the places have the same server name? I tried with the "Start->System->Http" Graphical settings, and put in "localhost" as my server name, but that did not work.

  9. #8
    Just Joined!
    Join Date
    Feb 2005
    Location
    Velden - Netherlands
    Posts
    80
    you can change the servername in:
    redhat -> system settings -> network
    tab hosts

    be sure to check the configs of your services for the changed hostname/servername.

    have you tried to access apache through the loopback (127.0.0.1)?

  10. #9
    Just Joined!
    Join Date
    Feb 2004
    Location
    I'd rather be in Hawaii
    Posts
    52
    have you tried to access apache through the loopback (127.0.0.1)?
    How do I do that?

  11. #10
    Just Joined!
    Join Date
    Feb 2005
    Location
    Velden - Netherlands
    Posts
    80
    put http://127.0.0.1 in your browsers adress bar
    or if it fails, the IP adres of your computer

    ps Do normal html pages in apache apear correct?

    else mail me your httpd.conf. I'll check it for you
    bikerepairman at gmail dot com

Page 1 of 2 1 2 LastLast

Posting Permissions

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