The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP doesnt work

Discussion in 'General Discussion' started by CGarson, Sep 29, 2002.

  1. CGarson

    CGarson Well-Known Member

    Joined:
    Jul 29, 2002
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    6
    For some reason, PHP does not work in Apache. Any time I wasnt to run a PHP file, it just brings up the download dialog.
     
  2. MrHits

    MrHits Well-Known Member

    Joined:
    Oct 31, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    do you have these lines in your apache conf at:
    /usr/local/apache/httpd.conf

    #support for php3

    AddType application/x-httpd-php .php3

    #AddType application/x-httpd-php3-source .phps

    # And for PHP 4.x, use:
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps
     
  3. CGarson

    CGarson Well-Known Member

    Joined:
    Jul 29, 2002
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    6
    All there
     
  4. MrHits

    MrHits Well-Known Member

    Joined:
    Oct 31, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Have you tired running the script from a command line to look at its output?


    What is the script doing?


    try running this:

    &?

    print &Hello World&;

    ?&

    name the file

    testing.php


    Another thing I woudl check is your .htaccess file in the directory serving the page, make sure nobody has modified it to change the mime types.
     
  5. CGarson

    CGarson Well-Known Member

    Joined:
    Jul 29, 2002
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    6
    Command line works just fine. mod_gzip is not installed
     
  6. MrHits

    MrHits Well-Known Member

    Joined:
    Oct 31, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    preoblem was:

    httpd.conf was missing the so's for php:

    LoadModule php4_module libexec/libphp4.so

    and in the moudle list:

    AddModule mod_php4.c


    resolution was to rebuild apache using buildapache.
     
Loading...

Share This Page