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 does not execute...

Discussion in 'General Discussion' started by horrighs, Jan 7, 2005.

  1. horrighs

    horrighs Well-Known Member

    Joined:
    Mar 8, 2003
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    I just setup a new server and my PHP doesnt seem to work outta the box.

    Whenever i link to a php file it starts to download it rather than execute it.

    i did notice in my httpd.conf these lines:

    LoadModule php4_module libexec/libphp4.so
    AddModule mod_php4.c

    both were commented out. but the wierd thing is on other servers of mine, they are commented out and things still work.

    I removed the comments and things started working but then after a recompile of apache the system commented them out again. so it really wants them commented out :)

    Any advice?

    Steve
     
  2. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    The comments are normally put there if you install php with the phpsuexec option in the easyapache installer. If you compiled php with phpsuexec then again without, im not sure if it would have uncommented those lines ( I have a feeling it doesn't ). So that might have been the cause.
     
  3. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    The LoadModule line is for including PHP as an Apache module. This is not how cPanel servers are usually set up, so it is probably correct that it is commented. PHP is usually ran as a CGI, in which case you should have the following in your httpd.conf:

    Code:
    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml
    You could add the lines manually, or run /scripts/easyapache (via SSH or WHM) with the PHP option enabled.

    Hope this helps ;)
     
  4. philb

    philb Well-Known Member

    Joined:
    Jan 28, 2004
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    There appears to be a bug in easyapache which will prevent it compiling apache with phpsuexec if the currently installed apache is already the latest version (despite the fact that phpsuexec rquires a patch to be applied to the apache source code and for apache to be recompiled.) Unfortunately it still manages to change httpd.conf to use the phpsuexec config directives, which of course breaks php completely.

    You can see how I worked around this problem (by forcing easyapache to always compile apache) here: http://forums.cpanel.net/showpost.php?p=162773&postcount=21
     
Loading...

Share This Page