Re: Vs: [PHP-WIN] Problem with: exec(), system()

From: Date: Sun, 18 Feb 2001 22:24:29 +0000
Subject: Re: Vs: [PHP-WIN] Problem with: exec(), system()
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-5628@lists.php.net to get a copy of this message
Running 'cmd.exe' will hang the php script because it is waiting for cmd.exe to do it's thing and finish (since it's a shell it will just sit there waiting for input). Try a command like 'dir' or something that executes and closes once it's finished... -mic ----- Original Message ----- From: "Johan Huhtalo" <johu@enea.se> To: <php-windows@lists.php.net> Sent: Thursday, February 15, 2001 10:11 PM Subject: Re: Vs: [PHP-WIN] Problem with: exec(), system() > Didn´t help :( > thanks anyway. > > samipetri.maijanen@kaukomarkkinat.fi wrote: > > > Try this: Needs the "K"-switch to work properly (on win2k anyway...) > > > > <?php > > print("Hello world!<BR>\n"); > > $cmd = "C:\\winnt\\system32\\cmd.exe /K \"dir C:\\\""; > > /* for test, want to use c:\\test\\test.exe, but gets the same errors > > */ > > $hmm = system( $cmd ); > > ?> > > > > T. SJM > > > > ps. I escaped the DIR C: => "DIR C:\" as well (\"DIR C:\\\"), even though > > it works without. > > > > Johan Huhtalo <johu@enea.se> > > 15.02.2001 12:12 > > > > > > Vastaanottaja: php-windows@lists.php.net > > Kopio: > > Aihe: [PHP-WIN] Problem with: exec(), system() > > > > I don´t know whats the problem with exex, system :( > > first time i get: error message: Warning: Unable to fork > > [C:\winnt\system32\cmd.exe dir C:\] in c:/program files/apache > > group/apache/htdocs/relay/relay.php4 on line 28 > > > > when second time, it hangs, i dont get any response from the server. > > i have to restart Apache to get the error msg again. > > > > using: Apache 1.3.14 on WinNT 4.0 > > PHP Version 4.0.4pl1 > > > > code: > > > > <?php > > print("Hello world!<BR>\n"); > > $cmd = "C:\\winnt\\system32\\cmd.exe dir C:\\"; /* for test, want to > > use c:\\test\\test.exe, but gets the same errors */ > > $hmm = system( $cmd ); > > ?> > > > > Thanks for help. > > > > -- > > Regards > > > > Johan > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > > For additional commands, e-mail: php-windows-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > > For additional commands, e-mail: php-windows-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > Regards > > Johan > > ========================================================= > Johan Huhtalo E-mail: johu@enea.se > Software Engineer > Enea OSE Systems AB > Box 232 > S-183 23 TABY Phone : +46-8-50-714-723 > Sweden Fax: +46-8-50-714-040 > GSM: +46-709-714-723 > WWW: www.enea.se/ose > ========================================================= > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#5628) next »