Re: Tip of the day: embedding php code in scripts
| From: | Roberto Berto | Date: | Wed, 22 May 2002 07:36:22 +0000 |
| Subject: | Re: Tip of the day: embedding php code in scripts | ||
| References: | 1 2 3 4 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-84258@lists.php.net to get a copy of this message | ||
Maybe there is a easy way to embed PHP into Zope.
> On Wed, 22 May 2002 00:24:32 -0700
> "Jonathan Sharp" <phplists@sharpmedia.net> wrote:
>
> > Also it could be usefull in creating a wrapped & suid exec that
> > would be completely self-contained...
> >
> > -js
> >
> > ----- Original Message -----
> > From: "Stig S. Bakken" <ssb@fast.no>
> > To: "Preston L. Bannister" <preston.bannister@cox.net>
> > Cc: "Stig S. Bakken" <Stig.Bakken@fast.no>; <php-dev@lists.php.net>
> > Sent: Monday, May 20, 2002 4:38 PM
> > Subject: RE: [PHP-DEV] Tip of the day: embedding php code in scripts
> >
> >
> > > On Mon, 2002-05-20 at 19:21, Preston L. Bannister wrote:
> > > > From: Stig S. Bakken [mailto:ssb@fast.no]
> > > > > Did anyone come up with this one before or do I have a "first
> > > > > post"?
> > :-)
> > > > >
> > > > > #!/bin/sh
> > > > > exec php -d output_buffering=1 $0 $@
> > > > > <?php
> > > > > ob_end_clean();
> > > > > print "Hello World!\n";
> > > > > ?>
> > > >
> > > > Or the shorter (and faster) version:
> > > >
> > > > #!/usr/local/bin/php -d output_buffering=1
> > > > <?php
> > > > ob_end_clean();
> > > > print "Hello World!\n";
> > > > ?>
> > > >
> > > > Or perhaps you had something else in mind?
> > >
> > > Uhm, well, you could just drop the output buffering in this case.
> > > I had the specific "embed in sh script" case in mind.
> > >
> > > > I believe most (all?) modern Unix implementations do #! handling
> > > > in the kernel's exec() function, so you avoid the /bin/sh
> > > > startup.
> > >
> > > Sure. The point is that you may not know the real path to the PHP
> > > executable, or you want to run PHP from a file that is processed
> > > with sh for some other reason.
> > >
> > > Another solution could be "#!/usr/bin/env php", all of the systems
> > > I've tested with had env in /usr/bin, but it's still not as cool
> > > :-)
> > >
> > > - Stig
> > >
> > >
> > > --
> > > PHP Development Mailing List
> > > <http://www.php.net/>
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> >
> >
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
> Atenciosamente,
>
> ---------------------------------------------------------
> Roberto Bertó, e-Consultor
> Cel: 51 91169628
> email: berto@under.com.br
>
> UNDER DEVELOPMENT - http://www.UNDER.com.br
> Tel/FAX: 51 32270599 Rua Duque de Caxias, 1594 apto. 204
> CEP 900010-281 - Porto Alegre - RS
> ---------------------------------------------------------
>
>
Atenciosamente,
---------------------------------------------------------
Roberto Bertó, e-Consultor
Cel: 51 91169628
email: berto@under.com.br
UNDER DEVELOPMENT - http://www.UNDER.com.br
Tel/FAX: 51 32270599 Rua Duque de Caxias, 1594 apto. 204
CEP 900010-281 - Porto Alegre - RS
---------------------------------------------------------
Attachment: [application/pgp-signature]
Attachment: [application/pgp-signature]