Results 1 to 4 of 4
  1. #1

    proc list only shows "/usr/bin/php" - no more file names???

    We use cpanel on our centos servers and we've updated our servers recently using easyapache to the latest php4 and mod_suphp and I've noticed that in top (running "top c" in shell) all php processes by any user are simply displayed as "/usr/bin/php"

    Before this update the processes also showed the file name eg. "/usr/bin/php lamescript.php" which allowed to easily find troublesome scripts ... but now there's no way of knowing what the script in question is that's eating up 100% of the cpu .. or is there?

  2. #2
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    8,910
    That is because cPanel switched from PHP suEXEC to suPHP (Yes, there's a difference) and suPHP by default only shows the program being executed and nothing more, IIRC.

    Since suPHP will give you the username + program while viewing the top output, you could tail the suPHP logs for further information as to what script is being accessed:

    tail -f /usr/local/apache/logs/suphp_log

    or

    tail -f /usr/local/apache/logs/suphp_log | grep username
    Patrick William | RACK911 Labs | Software Security Auditing
    400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com

    www.HostingSecList.com - Security notices for the hosting community.

  3. #3
    Thanks, I wasn't aware of this limitation imposed by the new suPHP and the logs help somewhat, however they are not 100% helpful as they do not mention the process IDs or anything of the sort.

    If a customer's site is entire PHP based, grepping the log file for their username will bring up hundreds/thousands of results, without a way of knowing which script is part of the process that is causing issues.

    Maybe the mod_suphp developers could add functionaly similar to phpsuexec's so that the script name is listed in process listings (in detailed top for example ie. top c)

  4. #4
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    You can get more details regarding a process from the following command. PID = Process ID

    lsof -p PID
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

Posting Permissions

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