Page 1 of 1

Execute a script independent from the main script

Posted: Mon Nov 06, 2006 5:35 am
by nc3b
Hello. I want to start a script from within another one and I want to child script to keep running even if the parent script stops. Can this be done? I know it can be done with exec, shell_exec, system, proc_open, popen, and so on. But what if the hosting company has disabled these functions. Is there any way to do this?

Posted: Mon Nov 06, 2006 6:28 am
by feyd
If they've disabled those functions, you're generally boned on the others.

cURL may be able to generate a remote request for the file (that doesn't wait), as could fsockopen(), fopen() and file_get_contents() (given proper directives are enabled.)

Posted: Mon Nov 06, 2006 6:36 am
by nc3b
So you are saying I should run the script from another computer than the server? I don't understand very well what curl does.. :oops:

Posted: Mon Nov 06, 2006 2:23 pm
by feyd
cURL acts as another browser. It can make requests just like most browsers. If the file you wish to run can be requested via a URL, cURL seems like an option as you can tell it not to wait for any return information before returning itself.