SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: PHP CLI Log

  1. #1
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,058
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)

    PHP CLI Log

    Okay, I'm stumped. I don't do a lot of PHP in a Production environment, let alone in a DEV/TEST environment, so I usually struggle with server setup from time to time as I only do it once every blue moon or two.

    My issue is I have a PHP script that takes a LONG time to execute, it could take hours. So it runs via CLI. However, it just quits after 20 minutes or so. No errors, no logs, nothing. I am using the -c argument to tell it what php.ini to use. The php.ini has display_errors turned on, the error_log is defined to a custom location that has write for owner, group and world, I haven't touched the max memory setting or any execution time (as those weren't touched on my prior server). I simply copied the php.ini from the prior server to the new one...

    So does anyone have any tricks for diagnosing this type of an issue? The only thing I haven't ruled out is if the script itself is exiting on its own and it isn't PHP that's closing the script (simply because I doubt that is the case, but I may have to profile the script to verify).

    I've done a few searches, but nothing has turned up yet that seems to be the resolution.

    Thanks!
    Be sure to congratulate Patche on earning July's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,604
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    There is a maximum for the amount of time a script can run set by the max_execution_time variable in the php.ini file:

    http://www.php.net/manual/en/info.co...execution-time
    http://php.net/manual/en/function.set-time-limit.php

    Those links also indicate that apache has its own maximum execution time, but I'm not familiar with that, since I haven't yet cause an issue for me.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,058
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Yeah, ends up those still don't apply to CLI (or at least I still haven't had to change those). I stumbled into the issue (though I still haven't got the error logging to work for CLI). Ended up the GD extension (which my script required) wasn't installed. You'd think that result in some sort of error written somewhere, but it didn't....

    Ah well, the script successfully completed after not being run for nearly 15 days, so it took nearly 148 minutes to complete. Should run MUCH faster now since it won't have that much "new" data to crunch.
    Be sure to congratulate Patche on earning July's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes


Bookmarks

Posting Permissions

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