timvw wrote:Deseree wrote:
screen
/usr/bin/php /path/to/script.php
At this point you have one screen open and you're running the php script in it.
You would detach with ctrl+a d (if i'm not mistaken, i changed my key mapping).
If you want to attach to the session again, you type: screen -D -r
Anyway, you can only give (extra) input to your script if your script is actually accepting input.
If you simply want another screen/terminal you can press ctrl+a n and you get a new screen..
Deseree wrote:There really isn't ANY way I can start the php script from http ?
Offcourse you can, fetch with wget, curl, ...
interesting....
on ctrl + a + d worked for detaching.....
If you simply want another screen/terminal you can press ctrl+a n and you get a new screen..
didn't work, it'd be nice jus to know how to do that without having to reenter the passsword, since i use really long ramdom digit keys.
Anyway, you can only give (extra) input to your script if your script is actually accepting input.
so you mean
/usr/bin/php /path/to/script.php 'run=insert'
is all I can do? I can't do :
/usr/bin/php /path/to/script.php 'run=insert&nextvar=2&etc=3'
? If i can't that's still cool, i can hard program in one var and call that var only from ssh to set other vars'.
Offcourse you can, fetch with wget, curl, ...
Would this call my script and end the CALL but not the script immediately?
See the importing of several hundred mb or few gb db takes HOURS if not days to complete, and I'm trying to program this little extra function that I can call the script
say
htto://
www.mysite.com/script/script.php?run=insert
is the importer, you set the vars in the script before uploading. once that's called it runs for hours on the browser or ssh, and if it's on the browser, it times out after a few hours, or the browser crashes because too much output, and if theres not output it times out after like 30-60 seconds usually, even with set_time_limit(0), the browser IE / FIREFOX is set to expire after 30-60-90 seconds of not recieving any data, so usually i keep alive by flushing() a period every import ( for loop )
now I used:
/usr/bin/php /path/to/script/script.php 'run=insert'
to call from ssh, but there is one more person using this script when i finish it, and he hates ssh, he wants to be able to start from http by clicking
htto://
www.mysite.com/script/script.php?run=insert
and it just starts, and outputs that it was started and he can close his browser and it goes. I''m hoping that's possible with some combination of ignore_user_abort(1), set_time_limit(1) and whatever you tell me, maybe curl can call the script and end it's http call after 3 seconds and it just runs in the back ground? Is that possible. course curl is more techinical than i'd like to get with this script, takes me hours to configure the proper curl, but would something like this do what I want?
:
Code: Select all
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, http://script_url.com/script/script.php?run=insert);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); // ZERO IS RIGHT YES?
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // HAVE CURL DROP THE CALL AFTER 10 seconds
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
And that uses http still to serve the connection huh? I'm trying to get the connection away from http as much as possible because it crashes http and then the import stops....
So.....
Disabled_functions are nothing. Host is whm/cpanel, safe mode off i think, maybe on- on his, php suexec i think is on his but off mine....
Would I be able to do:
system("/usr/bin/php /path/to/script.php 'run=insert'");
in the http script to have it call the insert db and begin importing, and then close my browser and it's not using http period and still running in the back ground?
I don't want to try crap without asking, lol... live server i'm on, no test servers atm...