Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts

    How can I see what php scripts are running?

    I have a bunch of php cron scripts that run every hour on my linux server. Sometimes one of them hangs up and consumes a lot of resources. How can I check to see if I have any php scripts running? If I can see the script name I'll know if it should be running still or not.

    Thanks
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Whew, been awhile myself:
    Code:
    ps -a | grep php
    Try that on the command line, it should give you any processes using the php executable.
    Follow it up with the kill command to delete the hanging resource. This shouldn't be a problem though, unless PHP is ignoring user abort and set to no timelimit, it should complete by itself. Unless its got some runtime errors giving it problems like infinite redirects to self or looping.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    rfresh (01-15-2010)


  •  

    Posting Permissions

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