473,396 Members | 1,799 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,396 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 4958
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.