php-windows Digest 8 Sep 2002 23:27:05 -0000 Issue 1329

Topics (messages 15708 through 15718):

exec() without waiting for completion in Win2k
        15708 by: Noel Llopis
        15711 by: Kurtis Harper
        15712 by: Rich Gray
        15715 by: Noel Llopis
        15717 by: Rich Gray
        15718 by: Noel Llopis

. becomes _ when submitting page
        15709 by: Kjell Hansen
        15714 by: Ignatius Reilly

GET / POST
        15710 by: XXXPixie
        15713 by: Rich Gray

mail() on W2K Pro
        15716 by: Ignatius Reilly

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 ---
Hello,

I'm working on a web front-end for our build system. One of the 
things I need to do is allow the user to start a lengthy build in the
back and continue using the web page.

Unfortunately, I can't find out how to do it. I can start the
build, but the web page won't complete loadinguntil the build 
finishes (which considering it can take up to 5 hours, it's 
not a good thing ;-)

I'm using Apache 1.3 under Win2k and PHP 4.2.3. I tried all 
combinations of exec ("cmd /c start build"), even doing
exec ("cmd /c start build.bat"), where build.bat contains
start build. Nothing. The web page always waits for the command
to finish.

I'm running PHP as an Apache module. I tried running it as
CGI but had no luck getting PHP to work at all.

Any suggestions? It's the most important thing this front 
end has to do. Without it, there would be no point to the program
in the first place.

Switching to Linux, unfortunately, is not an alternative I can 
consider right now since the build itself needs to happen 
in Win2k.

Thanks.


--Noel
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
I am having problems as well with exec() but this may help in your case, try
single quotes, eg add this to your php script:

exec ('start C:\path\to\your\bat\file\build.bat');

Hope this helps.

"Noel Llopis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I'm working on a web front-end for our build system. One of the
> things I need to do is allow the user to start a lengthy build in the
> back and continue using the web page.
>
> Unfortunately, I can't find out how to do it. I can start the
> build, but the web page won't complete loadinguntil the build
> finishes (which considering it can take up to 5 hours, it's
> not a good thing ;-)
>
> I'm using Apache 1.3 under Win2k and PHP 4.2.3. I tried all
> combinations of exec ("cmd /c start build"), even doing
> exec ("cmd /c start build.bat"), where build.bat contains
> start build. Nothing. The web page always waits for the command
> to finish.
>
> I'm running PHP as an Apache module. I tried running it as
> CGI but had no luck getting PHP to work at all.
>
> Any suggestions? It's the most important thing this front
> end has to do. Without it, there would be no point to the program
> in the first place.
>
> Switching to Linux, unfortunately, is not an alternative I can
> consider right now since the build itself needs to happen
> in Win2k.
>
> Thanks.
>
>
> --Noel
> [EMAIL PROTECTED]
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002


--- End Message ---
--- Begin Message ---
What does this do....?

exec(getenv('COMSPEC').' /c c:\path\to\your\bat\file\build.bat >NUL');

Do you see any errors in the log file?

Rich
-----Original Message-----
From: Kurtis Harper [mailto:[EMAIL PROTECTED]]
Sent: 08 September 2002 15:33
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: exec() without waiting for completion in Win2k


I am having problems as well with exec() but this may help in your case, try
single quotes, eg add this to your php script:

exec ('start C:\path\to\your\bat\file\build.bat');

Hope this helps.

"Noel Llopis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I'm working on a web front-end for our build system. One of the
> things I need to do is allow the user to start a lengthy build in the
> back and continue using the web page.
>
> Unfortunately, I can't find out how to do it. I can start the
> build, but the web page won't complete loadinguntil the build
> finishes (which considering it can take up to 5 hours, it's
> not a good thing ;-)
>
> I'm using Apache 1.3 under Win2k and PHP 4.2.3. I tried all
> combinations of exec ("cmd /c start build"), even doing
> exec ("cmd /c start build.bat"), where build.bat contains
> start build. Nothing. The web page always waits for the command
> to finish.
>
> I'm running PHP as an Apache module. I tried running it as
> CGI but had no luck getting PHP to work at all.
>
> Any suggestions? It's the most important thing this front
> end has to do. Without it, there would be no point to the program
> in the first place.
>
> Switching to Linux, unfortunately, is not an alternative I can
> consider right now since the build itself needs to happen
> in Win2k.
>
> Thanks.
>
>
> --Noel
> [EMAIL PROTECTED]
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---

On Sun, 08 Sep 2002 15:32:31 -0700
Kurtis Harper <[EMAIL PROTECTED]> wrote:

> I am having problems as well with exec() but this may help in your
> case, try single quotes, eg add this to your php script: exec ('start
> C:\path\to\your\bat\file\build.bat');

I'm afraid it didn't. Still the same problem. The page just waits for
the process to end.

On Sun, 08 Sep 2002 20:56:28 -0700
Rich Gray <[EMAIL PROTECTED]> wrote:

> What does this do....?
> 
> exec(getenv('COMSPEC').' /c c:\path\to\your\bat\file\build.bat >NUL');
> 
> Do you see any errors in the log file?

No luck with that either. COMSPEC is defined as D:\WINNT\system32\cmd.exe ,
which is what I would expect.


Here's a simplified version. How about starting notepad from PHP? Can
anybody do that and have the web page finish generating before Notepad
is closed? It helps to try it out with the console version of Apache,
that way you can close Notepad by hand (instead of having to kill it
from the process list).

If anybody can get that to work, let me know. I would change my
configuration to match yours. 

Thanks for all the suggestions so far.


--Noel
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Sorry ... I misunderstood (i.e. didn't bother to read your post fully!) -
look into running the AT command to run the command asyncronously

i.e.
<?
$time=date("H:i");
exec(getenv('WINDIR').'\\system32\\at.exe '.$time.'
C:\MyPath\MyScript.bat');
?>

Rich

-----Original Message-----
From: Noel Llopis [mailto:[EMAIL PROTECTED]]
Sent: 08 September 2002 13:43
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Re: exec() without waiting for completion in
Win2k



On Sun, 08 Sep 2002 15:32:31 -0700
Kurtis Harper <[EMAIL PROTECTED]> wrote:

> I am having problems as well with exec() but this may help in your
> case, try single quotes, eg add this to your php script: exec ('start
> C:\path\to\your\bat\file\build.bat');

I'm afraid it didn't. Still the same problem. The page just waits for
the process to end.

On Sun, 08 Sep 2002 20:56:28 -0700
Rich Gray <[EMAIL PROTECTED]> wrote:

> What does this do....?
>
> exec(getenv('COMSPEC').' /c c:\path\to\your\bat\file\build.bat >NUL');
>
> Do you see any errors in the log file?

No luck with that either. COMSPEC is defined as D:\WINNT\system32\cmd.exe ,
which is what I would expect.


Here's a simplified version. How about starting notepad from PHP? Can
anybody do that and have the web page finish generating before Notepad
is closed? It helps to try it out with the console version of Apache,
that way you can close Notepad by hand (instead of having to kill it
from the process list).

If anybody can get that to work, let me know. I would change my
configuration to match yours.

Thanks for all the suggestions so far.


--Noel
[EMAIL PROTECTED]


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---

On Sun, 08 Sep 2002 22:42:44 -0700
Rich Gray <[EMAIL PROTECTED]> wrote:

> Sorry ... I misunderstood (i.e. didn't bother to read your post fully!) -
> look into running the AT command to run the command asyncronously
> 
> i.e.
> <?
> $time=date("H:i");
> exec(getenv('WINDIR').'\\system32\\at.exe '.$time.'
> C:\MyPath\MyScript.bat');
> ?>

Hmmm... Tempting, but there is one big problem. I just found out that
commands executed with AT don't have access to network drives or
settings. Some of this build process involves fetching data over the
network, so it won't work.

I even wrote a C program that calls spawn() on the command you pass on
the command line, but it didn't work either. I can't believe how
frustrating this is. All of which could have been accomplished with a
sinmple & under Unix :-(

Any other ideas? I think I tried just about everything I could think of.
Thanks.


--Noel

> -----Original Message-----
> From: Noel Llopis [mailto:[EMAIL PROTECTED]]
> Sent: 08 September 2002 13:43
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Re: exec() without waiting for completion in
> Win2k
> 
> 
> 
> On Sun, 08 Sep 2002 15:32:31 -0700
> Kurtis Harper <[EMAIL PROTECTED]> wrote:
> 
> > I am having problems as well with exec() but this may help in your
> > case, try single quotes, eg add this to your php script: exec ('start
> > C:\path\to\your\bat\file\build.bat');
> 
> I'm afraid it didn't. Still the same problem. The page just waits for
> the process to end.
> 
> On Sun, 08 Sep 2002 20:56:28 -0700
> Rich Gray <[EMAIL PROTECTED]> wrote:
> 
> > What does this do....?
> >
> > exec(getenv('COMSPEC').' /c c:\path\to\your\bat\file\build.bat >NUL');
> >
> > Do you see any errors in the log file?
> 
> No luck with that either. COMSPEC is defined as D:\WINNT\system32\cmd.exe ,
> which is what I would expect.
> 
> 
> Here's a simplified version. How about starting notepad from PHP? Can
> anybody do that and have the web page finish generating before Notepad
> is closed? It helps to try it out with the console version of Apache,
> that way you can close Notepad by hand (instead of having to kill it
> from the process list).
> 
> If anybody can get that to work, let me know. I would change my
> configuration to match yours.
> 
> Thanks for all the suggestions so far.
> 
> 
> --Noel
> [EMAIL PROTECTED]
> 
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi,
In my HTML page I have a textarea called "filename.ext" when I submit
the page I get "filename_ext" in my $_POST array.

Anyone know why?!??!?

TIA
Kjell



--- End Message ---
--- Begin Message ---
Your naming conflicts with javascript. Remember what dots are used for in
js.

Avoid using other characters than alphanum and underscore. There is no
reason you should need to use any other character.

I am not quite even sure that it is valid HTML to use dots in attributes
values.

HTH

Ignatius

____________________________________________
----- Original Message -----
From: "Kjell Hansen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, September 08, 2002 7:12 PM
Subject: [PHP-WIN] . becomes _ when submitting page


> Hi,
> In my HTML page I have a textarea called "filename.ext" when I submit
> the page I get "filename_ext" in my $_POST array.
>
> Anyone know why?!??!?
>
> TIA
> Kjell
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
hi! I'm a total newbie to php4 or web design and i (of course) have a
problem:
i'm using apache 2.x and php4 as a module.
so, when i use the GET method to pass data to my php script:

script.php?x=5


 i can't access it as a normal global variable:

<?php
    print $x;
?>

the only way i can get to it is:

<?php
    print _GET['x']
?>

what's wrong?

by the way, what's the difference between GET and POST methods anyway?





--- End Message ---
--- Begin Message ---
Comments below...

-----Original Message-----
From: XXXPixie [mailto:[EMAIL PROTECTED]]
Sent: 08 September 2002 09:52
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] GET / POST


hi! I'm a total newbie to php4 or web design and i (of course) have a
problem:
i'm using apache 2.x and php4 as a module.
so, when i use the GET method to pass data to my php script:

script.php?x=5


 i can't access it as a normal global variable:

<?php
    print $x;
?>

the only way i can get to it is:

<?php
    print _GET['x']
?>

what's wrong?

RG> PHP v4.2.x has register_globals set to Off by default which is why you
have to access the _GET superglobal array - if security is not an issue then
either switch on register_globals again or do something like extract($_GET)
or extract($_REQUEST) at the top of your script...


by the way, what's the difference between GET and POST methods anyway?

RG> Very briefly .... http get method passes data via the query string/url,
http post method data is sent via the http headers - post method is more
secure (can't be tampered with easily) and can handle large data
transmissions with binary data, get is bookmarkable but is limited in size
and can be easily modified by a user...

HTH
RIch


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi,

I want to be able to use error_log() ( or mail() ) in a W2K Pro installation
(PHP 4.2). I suppose some kind of message queuing service or SMTP server has
to be installed.

I would appreciate if somebody who has done this successfully could give me
some indications.

Ignatius
____________________________________________

--- End Message ---

Reply via email to