php-windows Digest 4 Jun 2007 07:01:36 -0000 Issue 3249
Topics (messages 28034 through 28039):
Re: PHP and batch-files
28034 by: Elizabeth Smith
28035 by: Gustav Wiberg
28036 by: Niel Archer
28039 by: Gustav Wiberg
Re: Problems with working with large text files
28037 by: Stut
Program Execution functions.
28038 by: rumpy.mrbitter.org
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Gustav Wiberg wrote:
Hi there!
I want to use PHP to run as a "batch-file" on the server every night. What are the alternatives for doing this.
I'm using II6 and Win2003 Server, and PHP as an ISAPI-module. (vers 5.2.2)
Best regards
Gustav Wiberg
The easiest way to do this would be to simply install the cli binary as
well - php.exe (NOT php-cgi.exe) which doesn't need a webserver - and do
a scheduled task that calls "path to your cli"/php.exe "path to your
script here" - I use php a lot on windows for generic scripting tasks.
--- End Message ---
--- Begin Message ---
Hi there!
Where/how do I install that?
Best regards
/Gustav Wiberg
-----Original Message-----
From: Elizabeth Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, June 01, 2007 2:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: PHP and batch-files
Gustav Wiberg wrote:
> Hi there!
>
> I want to use PHP to run as a "batch-file" on the server every night. What
> are the alternatives for doing this.
> I'm using II6 and Win2003 Server, and PHP as an ISAPI-module. (vers 5.2.2)
>
> Best regards
> Gustav Wiberg
The easiest way to do this would be to simply install the cli binary as
well - php.exe (NOT php-cgi.exe) which doesn't need a webserver - and do
a scheduled task that calls "path to your cli"/php.exe "path to your
script here" - I use php a lot on windows for generic scripting tasks.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi
> Where/how do I install that?
It's part of the windows distribution.
Read the documentation here http://www.php.net/manual/en/install.general.php
for a start
Niel
--- End Message ---
--- Begin Message ---
Hi there!
Aha. Thanx. That was what I was searching for... :-)
Best regards
/Gustav Wiberg
-----Original Message-----
From: Lucas van Lierop [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 02, 2007 9:55 AM
To: 'Gustav Wiberg'; ''php windows''
Subject: FW: PHP and batch-files
Hej Gustav,
You can run php files also command line (without a webserver) just type:
php -f filename
If php is not recognized you need to specify the whole path to the php cli
executable
This way you can easily run php files from the windows task scheduler.
Check: http://nl2.php.net/manual/en/features.commandline.php
Hejdå!
Lucas
-----Original Message-----
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: vrijdag 1 juni 2007 13:38
To: 'php windows' ([EMAIL PROTECTED])
Subject: PHP and batch-files
Hi there!
I want to use PHP to run as a "batch-file" on the server every night. What
are the alternatives for doing this.
I'm using II6 and Win2003 Server, and PHP as an ISAPI-module. (vers 5.2.2)
Best regards
Gustav Wiberg
--- End Message ---
--- Begin Message ---
Please turn off read notifications when posting to a mailing list -
they're very annoying.
Adam Niedzwiedzki wrote:
(yeah ok.... But still doesn't explain why php ain't letting me (I'm
thinking BUG) :P)
Anyways this is how I'm handling the file...
if($fp = fopen($logfile, 'r')){
debug_log("$file has ".count(file($logfile))." lines to process");
while(!feof($fp)){
$line = fgets($fp);
You just made me relise I'm calling file() for the line count (That's a big
hit), any other way of doing it?
And YES I want a line count BEFORE I start looping through it...
Why?
Actually, why doesn't matter. If you really really need a line count
before you start processing it, then you'll have to run through the
while (feof) loop twice, once to count the lines and the second to
process them. If you were on a UNIX platform I would suggest calling out
to the wc utility - it's possible there's a version of that compiled for
windows somewhere and it would definitely be more efficient.
But I can't read line for line to do the gzcompress I have to load the whole
file up to compress it don't I?
gzcompress ($data, 9)
$data being the string (the whole file) of text I need to compress.
Two possible options... 1) write it out uncompressed and compress it
afterwards. Or 2) use the gz output buffer handler to do it (although
that may have the same effect on memory usage).
What is this script actually doing? There may be a better way[tm].
-Stut
--- End Message ---
--- Begin Message ---
Hi Folks,
One of my Windows (XP SP2) laptops has trouble executing any script
calling a Program Execution function. Specifically, I've tried
escapeshellcmd(), exec(), shell_exec(), and system(). No error message
is ever returned. The browser just spins it wheels forever trying to
execute the program execution function.
I've printed the command I'm trying to run in the browser and run the
same command maunally from the command line. Both work like a charm.
The script runs on Max OS X and my desktop system without a problem. I
also made sure Safe_mode was off in php.ini but that wasn't the issue.
Any feedback would be greatly appreciated.
Regards,
Josh.
--- End Message ---