-3

Possible Duplicate:
How to call another PHP script from a PHP script?

I want to run all the PHP scripts in a directory using PHP. Here's what I have:

foreach(glob('*.php') as $file)
  // Run $file
1
  • 2
    It's very well possible this is a very wrong solution to a different problem. Commented Dec 8, 2011 at 22:59

2 Answers 2

0

Look at exec. You could do something like this:

exec('/usr/bin/php ' . $file); 
Sign up to request clarification or add additional context in comments.

Comments

0

assuming a POSIX system

exec("nohup php $file >/dev/null 2>&1 &");

4 Comments

assuming a POSIX system of course.
always have to assume a lot of things, no one writes there questions with all the details.
It wasn't a critique of the answer. Merely letting anyone reading the answer know.
ye like right now im trying to determine how to do exactly this on a windows local server... no idea. nohup not an option it seems.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.