View previous topic :: View next topic |
Author |
Message |
phirez -
Joined: 22 Apr 2006 Posts: 57
|
Posted: Fri Sep 08, 2006 4:03 am Post subject: Run PHP w/o Webserver |
|
|
I know you can run a php script with this code: Code: | php.exe C:\path to\script.php | But can I do this for entire folders. ie. Code: | php.exe C:\path to folder | I tried this and it did not work so is there another command. |
|
Back to top |
|
|
Tim1681 -
Joined: 17 Jan 2005 Posts: 160 Location: Bristol, CT, USA
|
Posted: Fri Sep 08, 2006 4:36 am Post subject: |
|
|
Why would you want to execute a whole entire directory? _________________ mysql> SELECT * FROM users WHERE clue > 0;
0 rows returned.
|
|
Back to top |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Sep 08, 2006 8:22 am Post subject: |
|
|
This is not possibe. You can use some of the built in functions from PHP to read
a folder of files. Is this what you want?
http://www.php.net/readdir |
|
Back to top |
|
|
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Fri Sep 08, 2006 11:35 am Post subject: |
|
|
Use this script to execute all files in a folder. Didn't test it, should work however.
Code: | <?php
if ($handle = opendir('/some-dir')) {
while (false !== ($file = readdir($handle))) {
echo "\nRunning file: $file...\n";
include("/some-dir/".$file);
}
closedir($handle);
}
?> |
|
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Sep 08, 2006 1:32 pm Post subject: Re: Run PHP w/o Webserver |
|
|
phirez,
An easier way is to use the DOS shell commands as in:
Code: | for %f in (C:\pathto\*.php) do php.exe %f |
_________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
phirez -
Joined: 22 Apr 2006 Posts: 57
|
Posted: Sat Sep 09, 2006 2:28 am Post subject: |
|
|
Thank's for the help! |
|
Back to top |
|
|
|