PHP executable path help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Hearn

    PHP executable path help

    Hi,

    I'm a bit of a newbie, seeking help on how to run a .php from the shell.

    I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
    for web sites works great.

    However, to run a php script from the shell, do I need to install php
    from scratch?

    Thanks

    Andrew Hearn
  • Daniel Tryba

    #2
    Re: PHP executable path help

    Andrew Hearn <andrewhearn@ya hoo.com> wrote:[color=blue]
    > I'm a bit of a newbie, seeking help on how to run a .php from the shell.
    >
    > I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
    > for web sites works great.
    >
    > However, to run a php script from the shell, do I need to install php
    > from scratch?[/color]

    No, just install the php-cgi packages (php4-cgi*). This contains
    /usr/bin/php4 which you can use to run php scripts. Either use
    'php4 /foo/bar.php' or

    foo.php:
    #!/usr/bin/php4
    <?php
    echo "Hello world!\n";
    ?>

    --

    Daniel Tryba

    Comment

    • Andrew Hearn

      #3
      Re: PHP executable path help

      Daniel Tryba wrote:
      [color=blue]
      > Andrew Hearn <andrewhearn@ya hoo.com> wrote:
      >[color=green]
      >>I'm a bit of a newbie, seeking help on how to run a .php from the shell.
      >>
      >>I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
      >>for web sites works great.
      >>
      >>However, to run a php script from the shell, do I need to install php
      >>from scratch?[/color]
      >
      >
      > No, just install the php-cgi packages (php4-cgi*). This contains
      > /usr/bin/php4 which you can use to run php scripts. Either use
      > 'php4 /foo/bar.php' or
      >
      > foo.php:
      > #!/usr/bin/php4
      > <?php
      > echo "Hello world!\n";
      > ?>
      >[/color]

      Thanks for the help, this has worked... However I need IMAP support, is
      it possible to compile php4-cgi with IMAP support?

      Is it as simple as following the instructions at:


      Thank you!

      Andrew Hearn.

      Comment

      • Daniel Tryba

        #4
        Re: PHP executable path help

        Andrew Hearn <andrewhearn@ya hoo.com> wrote:[color=blue][color=green][color=darkred]
        >>>I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
        >>>for web sites works great.
        >>>
        >>>However, to run a php script from the shell, do I need to install php
        >>>from scratch?[/color]
        >>
        >> install the php-cgi packages (php4-cgi*)[/color]
        >
        > Thanks for the help, this has worked... However I need IMAP support, is
        > it possible to compile php4-cgi with IMAP support?[/color]

        To me it's unclear if you are using the packges from your distribution
        or your compiling yourself, but in the first case install php4-imap (and
        do a "dpkg -l 'php4*'" to find out what modules are available).

        --

        Daniel Tryba

        Comment

        • Shawn Wilson

          #5
          Re: PHP executable path help

          Andrew Hearn wrote:[color=blue]
          >
          > Hi,
          >
          > I'm a bit of a newbie, seeking help on how to run a .php from the shell.
          >
          > I'm running debian, with Apache-ssl which is compiled with mod_php4. PHP
          > for web sites works great.
          >
          > However, to run a php script from the shell, do I need to install php
          > from scratch?
          >
          > Thanks
          >
          > Andrew Hearn[/color]

          try "whereis php". It should show you where the executable is.

          Regards,
          Shawn
          --
          Shawn Wilson
          shawn@glassgian t.com

          Comment

          Working...