Re: popen returns true whether script exists or not?

From: Date: Wed, 15 Aug 2001 04:42:13 +0000
Subject: Re: popen returns true whether script exists or not?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-62761@lists.php.net to get a copy of this message
It may be returning a negative number which is an error code rather than a process pointer... What is $p really? If it's < 0, use 'man errno' to see what it means. -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Tom Hodder <t.hodder@globalgold.co.uk> Newsgroups: php.general To: <php-general@lists.php.net> Sent: Tuesday, August 14, 2001 1:15 PM Subject: popen returns true whether script exists or not? > > > Hi, > > I'm trying to popen a cgi script that was designed to be open via a SSI > include, but cannot because of passing variable restrictions. > > I'm popening a cgi script and it is returning a process pointer regardless > of whether the string passed to it points to anything. > Is this the expected response? > > <? > $p = popen( "/web/guide/myfiles/bannerzzzzz.cgi","r" ); > ?> > > this returns a process pointer even though bannerzzzzz.cgi doesn't exist > > I then need to read the results of the cgi script and dump them to the > screen like so; > > <? > while (!feof ($p)) { > $buffer = fgets($p, 4096); > echo $buffer; > } > pclose ($p); > ?> > > but this is not functioning, does anyone have any ideas? > > Regards > > Tom Hodder >

« previous php.general (#62761) next »