#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 1999
    Posts
    37
    Rep Power
    25
    Hi!

    I have a Linux machine with PHP installed in CGI mode. I use it for shell scripts, so there isn't even a web server on this machine.

    I would like to use PHP to write a daemon.

    So riddle me this:

    How does one remove the 30-second execution limit in PHP?
  2. #2
  3. No Profile Picture
    Viper_SB
    Guest
    Devshed Newbie (0 - 499 posts)
    Does it work to change the php.ini file where it says max execution time (or something like that) from 30 to what every you want.

    I don't really know about shell scripts but in scripts for the web you can add
    "set_time_limit(600);" (without quotes) and change 600 to how many seconds you want.

    ------------------
    Viper_SB
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 1999
    Posts
    37
    Rep Power
    25
    Hmm, I couldn't find "php.ini"; just "php.ini-dist" and "php.ini-optimized"

    I tried changing each of these, but it didn't help.

    Any other ideas?
  6. #4
  7. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    Try reading the comment header of the file, or the PHP install documentation. Things like that can help sometimes

    It basically says the file needs to be named php.ini to work, and it needs to be in the php current working directory. (usually /usr/local/lib)

    So copy php.ini-dist or php.ini-optimized to /usr/local/lib. Then you can change the execution time limits and many other things.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    79
    Rep Power
    15
    set_time_limit(0) will remove the time limit alltogether

Similar Threads

  1. Does using LIMIT speed up queries?
    By rlorenzo in forum MySQL Help
    Replies: 3
    Last Post: January 27th, 2004, 02:47 PM
  2. Displaying top 5 rows in DB using LIMIT
    By theDano in forum MySQL Help
    Replies: 4
    Last Post: October 30th, 2003, 03:26 PM
  3. Set Perl execution time limit ?
    By guden in forum Perl Programming
    Replies: 2
    Last Post: May 4th, 2003, 01:37 PM
  4. Replies: 3
    Last Post: April 14th, 2003, 04:44 AM
  5. socket limit? Perl or OS?
    By noslenj123 in forum Perl Programming
    Replies: 5
    Last Post: October 2nd, 2002, 08:43 PM

IMN logo majestic logo threadwatch logo seochat tools logo