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.

phpSuexec How to tell if is compiled?

Discussion in 'General Discussion' started by SupermanInNY, Mar 30, 2004.

  1. SupermanInNY

    SupermanInNY Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    255
    Likes Received:
    0
    Trophy Points:
    16
    phpSuexec, How to tell if is compiled into the Apache build?
    Where or how would I be able to see/check and know that it is 'in' or not in?

    thanks,

    -Alon.
     
  2. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    <?

    $fp = fopen("testing_suexec_file", "w");
    fwrite($fp, "test...");
    fclose($fp);
    $user = posix_getpwuid(fileowner("testing_suexec_file"));

    echo "You are running as user $user. <BR>\nIf this is nobody or httpd or apache, then you are not running phpsuexec. If it is your username then you are running phpsuexec";

    ?>
     
  3. SupermanInNY

    SupermanInNY Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    255
    Likes Received:
    0
    Trophy Points:
    16
    Hi and thanks for the fast input.
    Here is what I've done:

    I created test/ directory and gave it chmod 777
    inside of it,.. I placed the suex.php file with chmod 777
    and ran it.
    Here is what I got as a response:


    You are running as user Array.
    If this is nobody or httpd or apache, then you are not running phpsuexec. If it is your username then you are running phpsuexec

    user Array,... I can't tell which user this.
    Any insight?

    Thanks,

    -Alon.
     
  4. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    That's the hard way.

    Just login to ssh and do:
    php -v

    If it says (cli) it's an apache module. If it says (cgi) it's phpsuexec.
     
  5. SupermanInNY

    SupermanInNY Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    255
    Likes Received:
    0
    Trophy Points:
    16
    Below is my output.


    PHP 4.3.4 (cgi) (built: Feb 5 2004 23:54:16)
    Copyright (c) 1997-2003 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
    with Zend Extension Manager v1.0.0, Copyright (c) 2003, by Zend Technologies
    with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend Technologies



    According to your post,. I am running phpSuexec.
    Is this correct?

    -Alon.
     
  6. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Yep.
    If the php files are working, then phpsuexec is functioning.
     
  7. SupermanInNY

    SupermanInNY Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    255
    Likes Received:
    0
    Trophy Points:
    16
    Great!

    Thanks for all your help.

    -Alon.
     
  8. fishfreek

    fishfreek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    238
    Likes Received:
    0
    Trophy Points:
    16
    I thought to run phpsuexec you could not have php scripts with execute permission?
     
  9. kris1351

    kris1351 Well-Known Member

    Joined:
    Apr 18, 2003
    Messages:
    963
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lewisville, Tx
    For some reason when we compile Apache with phpsuexec on some servers the add-on domains die that use php. Any ideas on what could be the issue?
     
  10. kris1351

    kris1351 Well-Known Member

    Joined:
    Apr 18, 2003
    Messages:
    963
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lewisville, Tx
    [2004-04-10 10:13:57]: info: (target/actual) uid: (xxx/xxx) gid: (xxx/xxx) cmd: index.html
    [2004-04-10 10:13:57]: error: file has no execute permission:
     

Share This Page