473,221 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Run PHP-Script in Background

I am using php 5.0.4 under IIS 6 under Windows Server 2003 and want to
run a php-script as a separate process. This schript dies not have any
output. I tried several variants without success:

exec("c/php5/php.exe path/to/script parameters &") will run the schript
but will wait until the schript finished processing.

exec("c/php5/php.exe path/to/script parameters > null &") gives me the
error message "The specified CGI application exceeded the allowed time
for processing. The server has deleted the process."

Dealing with other variants of php cli procesors like php-win.exe gave
the same result. Also trying to use the start command did not help. My
head is burned out, what else could run my script under this
environment?

Thanks for any ideas.

Thomas

Sep 11 '05 #1
5 4947
Do you need your script to run constantly? Or should it run only once
after x-many days/hours/minutes?

I had a similar task to do in a W2K environment. I wrote a master PHP
script with set timings on when to run each secondary script bazed on
time of day. Then I just put that mster script in the Windows
scheduler so it runs every hour... That did my job but I don't know if
that's what you are looking for.

Sep 11 '05 #2
> Do you need your script to run constantly? Or should it run only once

It should run only once, and I need to send a parameter with. It's
actually a script which would run too long to wait on with the browser,
so it would run into the timeout limits. So I could look at the
progress with another script that runs periodically using a javascript
timer.

Sep 11 '05 #3
I can't think of how you can pass a parameter... perhaps through a
database... but for the timeout issue, you can dynamically set how long
you want your script to run.

Sep 11 '05 #4
Do you want to run the script as an INDEPENDENT process or start from
the web app and wait for the results?

If this is independent, maybe write the request in .net and update a
database?

You could also write a service on the machine to look for requests and
then process them.

On 11 Sep 2005 10:20:27 -0700, "Thomas" <tj@3sweb.net> wrote:
I am using php 5.0.4 under IIS 6 under Windows Server 2003 and want to
run a php-script as a separate process. This schript dies not have any
output. I tried several variants without success:

exec("c/php5/php.exe path/to/script parameters &") will run the schript
but will wait until the schript finished processing.

exec("c/php5/php.exe path/to/script parameters > null &") gives me the
error message "The specified CGI application exceeded the allowed time
for processing. The server has deleted the process."

Dealing with other variants of php cli procesors like php-win.exe gave
the same result. Also trying to use the start command did not help. My
head is burned out, what else could run my script under this
environment?

Thanks for any ideas.

Thomas


Sep 12 '05 #5
NC
Thomas wrote:

I am using php 5.0.4 under IIS 6 under Windows Server 2003 and want to
run a php-script as a separate process. This schript dies not have any
output. I tried several variants without success:

exec("c/php5/php.exe path/to/script parameters &") will run the schript
but will wait until the schript finished processing.


This is not Unix; "&" does not work here. Try this:

exec('start c:/php5/php.exe path/to/script parameters');

For more information, type "help start" at your Windows command
prompt.

Cheers,
NC

Sep 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
6
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the...
8
by: Marcel | last post by:
I have a problem with a PHP page that seems to get executed twice. I am running PHP5 ISAPI on 2003 server. The script is a PHP page with a form. When the form is submitted one record have to...
0
by: tsivaraman | last post by:
I am trying to build php-5.2.1 in RedHat Linux 9. I have installed libxml2-2.6.11,mysql-5.0.33,httpd-2.2.4(apache) successfully.When i do 'make' from the php directory,i get the following...
0
by: Yannick | last post by:
Hi, I'm Julien from France, We have recently install a new Web Server for my company The server is composed : - Linux RedHat RHEL4 U4 - Httpd-2.0.52-27.ent - Oracle Database 10.2.0.1
1
by: Kesavan | last post by:
I install apache2 in /usr/local/apache2 and install php5 by ./configure --with-apxs2=/usr/local/apache2/bin/ apxs PHP is successfully installed in my system. But now my .php files inside...
0
by: Benjamin Grieshaber | last post by:
Hi, I´m on SuSE 9.3 with xmlrpc-c and xmlrpc-c-devel installed (ver. 0.9.10) I tried to compile php with xmlrpc support and got the following errors: ...
9
by: mekalai82 | last post by:
i have information.php file that file contain following coding <?php echo phpinfo(); ?> while i calling the URL ("http://localhost/information.php"). i am getting the coding <?php echo...
4
by: mechphisto | last post by:
I'm working on a friend's box, Fedora Core 6. It has PHP 5.1.6. I need to install mcrypt into it, and the only way I can find to do it is from source then recompile PHP. So I did all that, and got...
5
Chrisjc
by: Chrisjc | last post by:
Good afternoon, I am seeking some php configuration help. Here is the run down I am running Windows server 2003 and IIS V6.0 I have never had issues before until now. I have Symantec Antivirus 11.0...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.