RE: Invoke PHP scripts?

2002-05-30 Thread Jim Helm

How about using php in cgi mode and using `php scriptname` from within
perl to capture the output?  Not the best performance-wise, but it would
do what you want, I think.

Jim

--
James Helm - Solaris System Administrator   [EMAIL PROTECTED]
WNS National Operations - Core Services [EMAIL PROTECTED]
ATT Wireless Services Inc. (425) 288-4395 (Desk) 
3555 Monte Villa Pkwy, Bothell, WA  98021   (206) 618-0438 (Cell)  

 -Original Message-
 From: Ryan Thompson [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, May 28, 2002 8:48 PM
 To: [EMAIL PROTECTED]
 Subject: Invoke PHP scripts?
 
 
 
 Hi there,
 
 Apologies if this has been asked 2^32 times, but I couldn't 
 seem to find anything in the archives or on the web which 
 would solve my problem.
 
 I'm developing a large-ish web site in which I would like to 
 use a combination of mod_perl (90%) and PHP (10%). I have run 
 into a roadblock trying to include the output of a PHP script 
 from a mod_perl script.
 
 This would do fine:
 
   my $r = Apache-request();
   return $r-lookup_uri($url)-run;
 
 But (and I am familiar with why this happens) run() dumps the 
 results to STDOUT, so the final HTML does not come through in 
 the correct order.
 
 I tried to use Apache::SSI in this manner:
 
   my $r = Apache-request();
   my $ssi = Apache::SSI-new($contents, $r);
   return $ssi-get_output();
 
 (Where $contents is the raw PHP source), but, possibly 
 because of some Content-type mixup, the output is returned as 
 expected (i.e., not dumped to stdout), but the PHP source is 
 not interpreted.
 
 So, in short, I need another way to invoke a PHP script from 
 my mod_perl application... exactly what !--#include 
 virtual=... -- would do.
 
 Help..? :-)
 
 - Ryan
 
 -- 
   Ryan Thompson [EMAIL PROTECTED]
 
   SaskNow Technologies - http://www.sasknow.com
   901 1st Avenue North - Saskatoon, SK - S7K 1Y4
 
 Tel: 306-664-3600   Fax: 306-664-3630   Saskatoon
   Toll-Free: 877-727-5669 (877-SASKNOW) North America
 




RE: Invoke PHP scripts?

2002-05-30 Thread Gabriel C Millerd

On Wed, 29 May 2002, Jim Helm wrote:

 How about using php in cgi mode and using `php scriptname` from within
 perl to capture the output?  Not the best performance-wise, but it would
 do what you want, I think.


will the cgi environment be preserved?

---
Gabriel Millerd |   When I grow up I want a job where I run around in
Plumber |circles chasing my tail like an idiot ten hours a day.
|-- Monster.com




Re: Invoke PHP scripts?

2002-05-29 Thread Thomas Klausner

Hi!

On Tue, May 28, 2002 at 09:48:14PM -0600, Ryan Thompson wrote:
 I'm developing a large-ish web site in which I would like to use a
 combination of mod_perl (90%) and PHP (10%). I have run into a
 roadblock trying to include the output of a PHP script from a mod_perl
 script.
As far as I know this is rather impossible with mod_perl 1.x

You can chain different perl handlers (but only perl handlers) using
Apache::Filter, or you could let your mod_perl application issue a real http
request (using LWP), parse the output, and then do what you want with it.

Apache 2.0 (and mod_perl 2.0) (both in BETA) can do what you want unsing
Filters.



-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: Invoke PHP scripts?

2002-05-29 Thread Andrew McNaughton



On Wed, 29 May 2002, Thomas Klausner wrote:

 Hi!

 On Tue, May 28, 2002 at 09:48:14PM -0600, Ryan Thompson wrote:
  I'm developing a large-ish web site in which I would like to use a
  combination of mod_perl (90%) and PHP (10%). I have run into a
  roadblock trying to include the output of a PHP script from a mod_perl
  script.
 As far as I know this is rather impossible with mod_perl 1.x

 You can chain different perl handlers (but only perl handlers) using
 Apache::Filter, or you could let your mod_perl application issue a real http
 request (using LWP), parse the output, and then do what you want with it.

It's possible to lock up your server under heavy load if it's calling
itself via HTTP.  between that and mysql handles I prefer to have separate
apache engines for php and modperl.

Andrew




Re: Invoke PHP scripts?

2002-05-29 Thread Stas Bekman

Ryan Thompson wrote:
 Thomas Klausner wrote to [EMAIL PROTECTED]:
 
 
Hi!

On Tue, May 28, 2002 at 09:48:14PM -0600, Ryan Thompson wrote:


I'm developing a large-ish web site in which I would like to use a
combination of mod_perl (90%) and PHP (10%). I have run into a
roadblock trying to include the output of a PHP script from a
mod_perl script.

How about using notes()?
http://perl.apache.org/release/docs/1.0/guide/snippets.html#Passing_Notes_Between_mod_perl_and_other__non_Perl__Apache_Modules


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Invoke PHP scripts?

2002-05-28 Thread Ryan Thompson


Hi there,

Apologies if this has been asked 2^32 times, but I couldn't seem to
find anything in the archives or on the web which would solve my
problem.

I'm developing a large-ish web site in which I would like to use a
combination of mod_perl (90%) and PHP (10%). I have run into a
roadblock trying to include the output of a PHP script from a mod_perl
script.

This would do fine:

  my $r = Apache-request();
  return $r-lookup_uri($url)-run;

But (and I am familiar with why this happens) run() dumps the results
to STDOUT, so the final HTML does not come through in the correct
order.

I tried to use Apache::SSI in this manner:

  my $r = Apache-request();
  my $ssi = Apache::SSI-new($contents, $r);
  return $ssi-get_output();

(Where $contents is the raw PHP source), but, possibly because of some
Content-type mixup, the output is returned as expected (i.e., not
dumped to stdout), but the PHP source is not interpreted.

So, in short, I need another way to invoke a PHP script from my
mod_perl application... exactly what !--#include virtual=... --
would do.

Help..? :-)

- Ryan

-- 
  Ryan Thompson [EMAIL PROTECTED]

  SaskNow Technologies - http://www.sasknow.com
  901 1st Avenue North - Saskatoon, SK - S7K 1Y4

Tel: 306-664-3600   Fax: 306-664-3630   Saskatoon
  Toll-Free: 877-727-5669 (877-SASKNOW) North America