asynchronous PHP
- From: Lawrence Krubner <lawrence@xxxxxxxxxxx>
- Date: Mon, 29 Dec 2008 02:44:26 -0500
The server I'm working on right now allows PHP scripts to run for 300 seconds. I need to get around that. I'm writing a script that pings the Google Ajax API. The script is called as a cron job. It needs to make over 100,000 queries against Google.
I thought maybe I could get around the time limit by having the first script call other scripts, like this:
shell_exec("callGoogle1.php");
shell_exec("callGoogle2.php");
shell_exec("callGoogle3.php");
shell_exec("callGoogle4.php");
shell_exec("callGoogle5.php");
But the first PHP scripts waits for shell_exec() to return before making the next call. So how do I break out of the procedural, step-by-step approach that PHP takes? Is there a correct way to do this?
(My other option is to maybe write a macro for FireFox so that the browser on my home machine fires off a bunch of AJAX requests to PHP scripts that are on my server, but that seems like a hell of a hack, and quite fragile too.)
.
- Follow-Ups:
- Re: asynchronous PHP
- From: NC
- Re: asynchronous PHP
- From: "Álvaro G. Vicario"
- Re: asynchronous PHP
- From: rf
- Re: asynchronous PHP
- Prev by Date: Re: Is there a better way?
- Next by Date: Re: asynchronous PHP
- Previous by thread: mysqli error?
- Next by thread: Re: asynchronous PHP
- Index(es):
Relevant Pages
|