PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Sup guys, I have a script that should run for 1 hour maximum or less if the for loop finishes faster... but it's not ending, the processes never stops, always shows up until my server/computer crashes from too may processing being ran.....
Make sure the server is ALLOWING you to set the timeout. If your server is running with SAFE_MODE enabled then you cannot change the script timeout using set_time_limit. It will be completely ignored and no error will be given. Then it relies on the max_execution_time set in the php.ini. Also, if you are performing any system calls inside a php script and it is getting locked into a loop inside a system call then you are out of luck because the max_execution_time and set_time_limit do not affect system calls.
AKA Panama Jack wrote:Make sure the server is ALLOWING you to set the timeout. If your server is running with SAFE_MODE enabled then you cannot change the script timeout using set_time_limit. It will be completely ignored and no error will be given. Then it relies on the max_execution_time set in the php.ini. Also, if you are performing any system calls inside a php script and it is getting locked into a loop inside a system call then you are out of luck because the max_execution_time and set_time_limit do not affect system calls.
safe mode is off, max_executtion_time is 30 . set_time_limit is not disabled in php, infact nothing is atm.
no system, or exec calls on my script, simple file() and file_get_contents() and a little bit of curl in some places.
By using the flush command after each echo you are forcing PHP to flush its output buffers. You should then be able to see approximately WHERE in your loop the program is stopping. I wouldn't surprise me if it is halting on a CURL execution.
If you are running a windows server this will not do anything unfortunately.
By using the flush command after each echo you are forcing PHP to flush its output buffers. You should then be able to see approximately WHERE in your loop the program is stopping. I wouldn't surprise me if it is halting on a CURL execution.
If you are running a windows server this will not do anything unfortunately.
lol, yes this is what i call debugging and i've done this already, just i run everything hidden on my windows pc ( via windows cron ) and i run things using cron on the server.....
sometimes i try running things via screen and watch the progress, sometimes it finishes, sometimes it doesn't and just gets stuck, i don't know exactly where inside the loop since all my outputting is outside the loop, but i guess i'll put somemore inside and figure out.