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.

how to tell if php is installed as a module (and how to change it!)

Discussion in 'General Discussion' started by dhecker, Oct 17, 2005.

  1. dhecker

    dhecker Well-Known Member

    Joined:
    Dec 3, 2003
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    Hello -

    A developer is trying install something on my machine, and he's telling me that he can't because php is installed as a module.

    How can I check to see if it's true?

    and

    How can I change the way it's installed??/

    any advice appreciated!! thanks, Dave
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Go to WHM > Software > Update Apache > Load Previous Config.

    If PHP suEXEC Support is not checked, PHP will be running as an Apache module. If you don't want to run PHP as an Apache module, check the suEXEC option and rebuild Apache.

    Bear in mind that if you plan to do so, please please please search these forums for phpsuexec and find out about it beforehand.
     
  3. dhecker

    dhecker Well-Known Member

    Joined:
    Dec 3, 2003
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    I did this, and it IS checked. However, I wonder if it's loading the last config that I entered into this screen, which had that box checked but failed to work properly.

    The last ACTUAL build was done with /scripts/easyapache using option 1 :D
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The easiest solution, place a phpinfo.php file (or name it whatever you want, it doesn't make any difference) in the directory that you are installing the script. Normally just your public_html directory should be sufficient. Place the following code in that file:

    PHP:
    <?php
    phpinfo
    ();
    ?>
    Now visit that page in your browser. Near the top, there will be a heading name Server API. If this says Apache, then your account is running PHP as an Apache module. If it says CGI then it is running as a CGI script, probably with PHPSuExec.
     
  5. fuzzymonkey

    fuzzymonkey Well-Known Member

    Joined:
    Jun 11, 2004
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Do option 2 if you want phpsuexec, and I believe all the other options are without.
     
  6. PanelGuy

    PanelGuy Well-Known Member

    Joined:
    Oct 13, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    phpinfo.php

    When I run this file, it shows neither, but PHP shows as working from the command line.

    What did I do wrong and most importantly, how the heck do I fix it?

    Also I was told DO NOT use PHPSuExec with PHP 5.0.4, use the regular suexec. Some security isssue. is this true?
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You can easily tell if you're using php as a module or via CGI by searching httpd.conf for mod_php:

    grep mod_php /usr/local/apache/conf/httpd.conf

    If it comes back with a commented in AddModule line, then you're using the module and not phpsuexec.
     
  8. PanelGuy

    PanelGuy Well-Known Member

    Joined:
    Oct 13, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    MySQL Module or CGI

    Hmmm, does this tell you anything? It's the exact output.


    grep mod_php /usr/local/apache/conf/httpd.conf
    #AddModule mod_php4.c
    AddModule mod_php5.c
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
    <IfModule mod_php4.c>
    <IfModule mod_php5.c>
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    This:
    Would suggest that you are running php5 using php as a module, not as CGI (phpsuexec).
     
Loading...

Share This Page