Command-line interface

This is a discussion on Command-line interface within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi. In the docs, it says the command-line executable (that allows you to run PHP scripts on your console ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-10-2004
Ever Olano
 
Posts: n/a
Default Command-line interface

Hi. In the docs, it says the command-line executable (that allows you to
run PHP scripts on your console as opposed to inside the web server) was
introduced in 4.3.0. But I was told by someone that he can do command-line
stuff with 4.1.0.

Is anyone else using the command-line executable with a version earlier than
4.3.0?

Thanks!


Reply With Quote
  #2 (permalink)  
Old 06-10-2004
Gordon Burditt
 
Posts: n/a
Default Re: Command-line interface

>Hi. In the docs, it says the command-line executable (that allows you to
>run PHP scripts on your console as opposed to inside the web server) was
>introduced in 4.3.0. But I was told by someone that he can do command-line
>stuff with 4.1.0.
>
>Is anyone else using the command-line executable with a version earlier than
>4.3.0?


There are 3 ways to use PHP: web browser module, CGI, and standalone
executable. Web applications generally prefer the web browser
module approach if they can use it (does it work with browsers other
than Apache?)

The manual for PHP 2.0/FI, available on www.php.net if you look for
it hard enough ( at http://www.php.net/manual/phpfi2.php#commandline
), has documentation on how to use the CGI executable as a command-line
PHP interpreter. I believe the command-line feature has been around
a long time, although it looks a lot like shoe-horning the CGI
module into another use. I'm not sure this version allowed passing
command-line arguments that you could get at, though. That seems
to have been introduced around 4.2.0, along with other features for
the command line like not producing HTTP headers by default.

I've used it in the past, including before the existence of
superglobals, which were introduced in 4.1.0 (I think). It's great
to make backend scripts for maintaining a database that is mostly
manipulated by PHP web pages anyway, but this part isn't activated
by a web page (e.g. periodically expiring old entries, taking stuff
entered by web page and actually DOING something with it after it
goes into the database, etc.) I've since upgraded to a later version,
but it existed and worked.

Gordon L. Burditt
Reply With Quote
  #3 (permalink)  
Old 06-10-2004
Chris Hope
 
Posts: n/a
Default Re: Command-line interface

Ever Olano wrote:

> In*the*docs,*it*says*the*command-line*executable*(that*allows*you*to
> run PHP scripts on your console as opposed to inside the web server) was
> introduced in 4.3.0.**But*I*was*told*by*someone*that*he*can*do
> command-line stuff with 4.1.0.
>
> Is anyone else using the command-line executable with a version earlier
> than 4.3.0?


You can use the CGI binary from the command line. To compile the CGI version
you leave out the --with-apxs configure flag.

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/
Reply With Quote
  #4 (permalink)  
Old 06-10-2004
Ever Olano
 
Posts: n/a
Default Re: Command-line interface

Oh okay, thanks to both of you! He was probably referring to the CGI binary
then.

"Chris Hope" <chris@electrictoolbox.com> wrote in message
news:1086899626_33401@news.athenanews.com...
Ever Olano wrote:

> In the docs, it says the command-line executable (that allows you to
> run PHP scripts on your console as opposed to inside the web server) was
> introduced in 4.3.0. But I was told by someone that he can do
> command-line stuff with 4.1.0.
>
> Is anyone else using the command-line executable with a version earlier
> than 4.3.0?


You can use the CGI binary from the command line. To compile the CGI version
you leave out the --with-apxs configure flag.

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:03 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0