Re: RE: PHP 4.0 Bug #8465 Updated: Cannot exec, system, passthru, backticks

From: Date: Fri, 29 Dec 2000 00:55:38 +0000
Subject: Re: RE: PHP 4.0 Bug #8465 Updated: Cannot exec, system, passthru, backticks
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-42498@lists.php.net to get a copy of this message
popen() doesn't work in the environment. In fact I don't think it works in any non-console environment. The correct way of fixing this is to implement an alternative with CreateProcess(). It has been discussed before but no one has had time to get around to it. Andi At 07:34 PM 12/28/00 -0500, Che Gonzalez wrote:
        You example does not work either in CGI mode.  I originally tried
backticking a perl -v normally and with the absolute path. I understand cmd /c, but I wasn't even trying to use that. I'm trying to execute some perl 3des functions since the mcrypt library hasn't been ported to PHP on Win32. I perused the source and I think there should be some testing on 'virtual_popen' in 'tsrm_virtual_cwd.c'. I see that you are not using CreateProcess, but you are _popen. I know there are issues when spawning processes from isapi, but maybe CreateProcess detached and capturing the output might work. Its just an idea... I not very knowledgeable with isapi. As far as your 'I'll do us both a favo!(u)r and ignore your other comments' comment, I don't think it should be ignored. I hate ASP with a passion and due to my roots in perl... I have found a home with PHP. I hope that we can put ASP out of commission. -----Original Message----- From: Bug Database [mailto:php-dev@lists.php.net] Sent: Thursday, December 28, 2000 6:17 PM To: che@atlantic.net Subject: PHP 4.0 Bug #8465 Updated: Cannot exec, system, passthru, backticks ID: 8465 Updated by: lyric Reported By: che@atlantic.net Status: Open Bug Type: Program Execution Assigned To: Comments: "echo" is not a command under windows, rather something built into the shell (cmd.exe). Hence the error message is correct - you can't run a command that doesn't exist. You should use something like "cmd /c echo hello world". I'll do us both a favour and ignore your other comments Previous Comments: --------------------------------------------------------------------------- [2000-12-28 17:27:44] che@atlantic.net <?php
    print echo hello world;
?> I have tried exec, backticks, system, passthru, and they all do not work. When running the CGI version, there is no message displayed. When running the isapi version, I get the error message "Warning: Unable to fork [echo hello world] in c:inetpubwwwroothorus.atlantic.nettest.php on line 3". It seems that this has been going on for a while now. "CreateProcess" is a very simple Windows API call. If PHP is going to beat ASP, this needs to be resolved. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=8465 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#42498) next »