Reputation: 351
I'm making a project on PHP and it pretty much doesn't involve any human intervention, in other words, I'm making a special script that should run for a long time (a user visits my website and the script keeps running until the user exits...). The one problem that is concerning me is:
Won't the sessions expire when the script runs like this for a while? If So how could I bypass that, so it could run for a very a long time?
Oh, And one more question: Could my PHP script start by its own without any user intervention? If so, How could I configure it to do so?
Upvotes: 0
Views: 220
Reputation: 1294
Upvotes: 1
Reputation: 14014
You can run PHP from the command line. Those scripts do not have a timeout like user-called scripts. Otherwise, you can set the timeout with set_time_limit like
set_time_limit(0); // 0 means no limit
See http://php.net/manual/en/function.set-time-limit.php
Upvotes: 1