Re: shtml or php ??

From: Date: Fri, 03 Aug 2001 02:38:10 +0000
Subject: Re: shtml or php ??
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-61058@lists.php.net to get a copy of this message
> Which is the best language to use, php or shtml, I use only a couple of SSI Well, SSI has like, 5 things it can do, and PHP has about 50,000. I guess you have to decide which is better for yourself. > in one of my shtml i use the <!--#exec cgi="my.cgi"--> command, but how do > I run an external .cgi script from php, I have looked at many of the > commands such as include(), system(), passthru() , but cant find away to do > it. Can someone help ?? exec('/full/path/to/my.cgi', $results, $errorcode); while (list(,$line) = each($results)){ echo $line, "<BR>\n"; } if ($errorcode){ echo "OS Error: $errorcode. Usually path/permissions. Use 'man errno' to check<BR>\n"; } > Is it best for me to leave it in shtml as I have also discovered that SSI > will not parse inside an html section in php. When Apache gets a request, it looks at the extension to figure out to whom to hand it off. It can't hand it off to both PHP and SSI at once. Allegedly Apache 2.0 would allow "stacked handlers" where PHP would process the file, then SSI could process the output from that, then Apache gets the answer back... > Which of these shtml, or php > uses more resources on the server ? PHP probably uses more resources for its 50,000 functions than SSI for its 5. Your biggest expense though is firing up my.cgi with exec() in either case, and I'm willing to bet that you could eventually re-code whatever is inside of my.cgi using just PHP with no exec() and then you'd be using less resources. > Which is the best solution to my > problem ?? PHP does everything SSI does, and 49,995 things more. :-) -- 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

« previous php.general (#61058) next »