473,387 Members | 1,569 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,387 software developers and data experts.

Running a PHP script from within another without blocking?

I have a PHP script which needs to run some other PHP scripts from within it. I need them to be executed on a timed basis, say, every minute. However, they can take a little while to run, and I do not need a response.

Unfortunately, the only solutions I have found all require me to be on a Unix system, but this server is running windows.

Right now I have a loop which does exec call to PHP and running the second script, but as you probably know, exec blocks and waits for a response, which is exactly what I don't want. If I wanted to wait, I would just put the code from the second file inside of the first one and merge them into one script.

Also, I'd really like to do this in PHP. I'd prefer if people could refrain from replies telling me to switch to ASP.NET or VBScript or cron or something, as that's not really the kind of solution I am looking for :)

Thanks for your help in advance, and if you need more clarification, I will provide what I can! I've been googling for the last 2 days trying to find an appropriate solution, to no success.
Jul 24 '08 #1
1 1519
djpaul
137 100+
Hi,
Php runs only when it's requested.
I have something like that that does it 1 time so you can make a loop for it.
Try something like this....:


[PHP]
?>
include ("file.php");

//Then echo a html refresh wich refreshes every hour

for ($i = 0; $i <= 24; $i++){
echo '<meta http-equiv="refresh" content="3600" />
}

?>
[/PHP]

So you can run a script every hour or another time.
But you need to leave your computer on and on this page!

Good luck!
P.
Jul 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the...
0
by: James-D-Bloom | last post by:
I have developed a fully open source & free application that can alter (or simulate the affect of altering) loaded Java classes at runtime. This means you can change a program at runtime without...
4
by: Noen | last post by:
Im developing a game where the players will program their equipment with python. Are there any ways to run insecure code? I dont want the clients to mess with the server-code through their own...
6
by: Pierre-Yves | last post by:
Hello, I would like to prevent my perl program to be executed several times simultaneously (if the program is already running, I would like to display a message like "another instance of this...
2
by: Maik | last post by:
I Need a popup-killer script
6
by: von | last post by:
Is it possible to run a Perl script from within a javascript? I have an existing javascript that provides some data - and I want to write that data to a text file on my server via a Perl script...
8
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
9
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
6
by: ADT_CLONE | last post by:
Hello guys, Right now I have run into a problem. In my windows application I wish to run a function called waitForClient(), which waits for a clients connection using WinSock. Anyway, within the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.