running php scripts from the command line in 4.2.3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob Ristroph

    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
  • Pedro Graca

    #2
    Re: running php scripts from the command line in 4.2.3

    Rob Ristroph wrote:[color=blue]
    > 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.[/color]

    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 =--

    Comment

    • CountScubula

      #3
      Re: running php scripts from the command line in 4.2.3

      "Rob Ristroph" <rgr@sdf.lonest ar.org> wrote in message
      news:87oethxafo .fsf@rgristroph-austin.ath.cx.. .[color=blue]
      >
      > 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[/color]

      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


      Comment

      • Rob Ristroph

        #4
        Re: running php scripts from the command line in 4.2.3

        >>>>> "Pedro" == Pedro Graca <hexkid@hotpop. com> writes:
        Pedro>
        Pedro> Rob Ristroph wrote:[color=blue][color=green]
        >> 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.[/color][/color]
        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

        Comment

        Working...