running php scripts from the command line in 4.2.3

This is a discussion on running php scripts from the command line in 4.2.3 within the PHP Language forums, part of the PHP Programming Forums category; I'm helping someone who is running a server with Debian testing, which only has PHP 4.2.3, not ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-06-2004
Rob Ristroph
 
Posts: n/a
Default running php scripts from the command line in 4.2.3


I'm helping someone who is running a server with Debian testing, which
only has PHP 4.2.3, not higher. He wants to run php from the command
line, which I think is only supported starting with 4.3. Is there a
way to do it with 4.2.3 ? I am trying to avoid installing a newer
version of php from source, as the machine has a running webserver on
it that I would not like to break for more than a few minutes.

--Rob
Reply With Quote
  #2 (permalink)  
Old 01-06-2004
Pedro Graca
 
Posts: n/a
Default Re: running php scripts from the command line in 4.2.3

Rob Ristroph wrote:
> I'm helping someone who is running a server with Debian testing, which
> only has PHP 4.2.3, not higher. He wants to run php from the command
> line, which I think is only supported starting with 4.3. Is there a
> way to do it with 4.2.3 ? I am trying to avoid installing a newer
> version of php from source, as the machine has a running webserver on
> it that I would not like to break for more than a few minutes.


Maybe this works in testing too. I used it in unstable

root# apt-get install php4-cgi
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Reply With Quote
  #3 (permalink)  
Old 01-06-2004
CountScubula
 
Posts: n/a
Default Re: running php scripts from the command line in 4.2.3

"Rob Ristroph" <rgr@sdf.lonestar.org> wrote in message
news:87oethxafo.fsf@rgristroph-austin.ath.cx...
>
> I'm helping someone who is running a server with Debian testing, which
> only has PHP 4.2.3, not higher. He wants to run php from the command
> line, which I think is only supported starting with 4.3. Is there a
> way to do it with 4.2.3 ? I am trying to avoid installing a newer
> version of php from source, as the machine has a running webserver on
> it that I would not like to break for more than a few minutes.
>
> --Rob


just type :
php filename.php

or make it into a shell script add the first line to the script
#!/bin/php -q

then chmod 755 the file

the to run it ./filename.php

or stick a copy in

/usr/bin

btw, if you are making a shell script, it does not
need the .php extention. it doesnt need one at all

I have a shell script that I wrote in php called srestart
it restarts services properly on my boxes.

ie:
srestart httpd
srestart mail
srestart dns


--
Mike Bradley
http://www.gzentools.com -- free online php tools


Reply With Quote
  #4 (permalink)  
Old 01-06-2004
Rob Ristroph
 
Posts: n/a
Default Re: running php scripts from the command line in 4.2.3

>>>>> "Pedro" == Pedro Graca <hexkid@hotpop.com> writes:
Pedro>
Pedro> Rob Ristroph wrote:
>> I'm helping someone who is running a server with Debian testing,
>> which only has PHP 4.2.3, not higher. He wants to run php from the
>> command line, which I think is only supported starting with 4.3.
>> Is there a way to do it with 4.2.3 ? I am trying to avoid
>> installing a newer version of php from source, as the machine has a
>> running webserver on it that I would not like to break for more
>> than a few minutes.

Pedro>
Pedro> Maybe this works in testing too. I used it in unstable
Pedro>
Pedro> root# apt-get install php4-cgi

This is exactly what I needed to do. Thank you very much.

--Rob
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 07:29 AM.


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