command-line PHP problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • comp.lang.php

    command-line PHP problem

    I am trying to pipe in some auto-generated PHP into php.exe, to no
    avail:

    catch {exec echo '<? if (@is_file("./functions.inc.p hp")) {
    require_once("./functions.inc.p hp"); echo xml_to_tcl_list ("&lt;?xml
    version=&quot;1 .0&quot; encoding=&quot; utf-8&quot;
    ?&gt;&lt;fortun e&gt;&lt;sayi ng id=&quot;1&quot ; author=&quot;Ph il
    Powell&quot; phrase=&quot;Ne w York is SO
    Superior!&quot; &gt;&lt;/saying&gt;&lt;s aying id=&quot;2&quot ;
    author=&quot;Ph il Powell&quot; phrase=&quot;SU BMIT
    STUFF!&quot;&gt ;&lt;/saying&gt;&lt;s aying id=&quot;3&quot ;
    author=&quot;Ol d Screams of Abel Slogan&quot; phrase=&quot;Sa nctify the
    Underground!&qu ot;&gt;&lt;/saying&gt;&lt;s aying id=&quot;4&quot ;
    author=&quot;Ph il Powell&quot; phrase=&quot;I believe animals have
    rights.. they have a right to be on my dinner
    plate&quot;&gt; &lt;/saying&gt;&lt;s aying id=&quot;5&quot ;
    author=&quot;La rs Walker&quot; phrase=&quot;.. The minimalist approach
    is also interesting. Sort of a Scandinavian Modern web
    site&quot;&gt;& lt;/saying&gt;&lt;s aying id=&quot;6&quot ;
    author=&quot;Ph il Powell&quot; phrase=&quot;Do n&#034;t forget to sign
    the guestbook!&quot ;&gt;&lt;/saying&gt;&lt;s aying id=&quot;7&quot ;
    author=&quot;Ph il Powell&quot; phrase=&quot;Ja g vill tillbaka till mitt
    hemland!&quot;& gt;&lt;/saying&gt;&lt;s aying id=&quot;8&quot ;
    author=&quot;Ph il Powell&quot; phrase=&quot;Le t us sit by the bonfire,
    roasting slabs of meat, telling tales of musical
    conquest&quot;& gt;&lt;/saying&gt;&lt;s aying id=&quot;9&quot ;
    author=&quot;Ph il Powell&quot; phrase=&quot;Wa nt to know God&#034;s
    wonderous sense of grace? You still
    exist.&quot;&gt ;&lt;/saying&gt;&lt;s aying id=&quot;10&quo t;
    author=&quot;Ph il Powell&quot; phrase=&quot;Gu d Rockar - God
    Rocks!&quot;&gt ;&lt;/saying&gt;&lt;s aying id=&quot;11&quo t;
    author=&quot;Ph il Powell&quot; phrase=&quot;I need
    CAFFEINE!&quot; &gt;&lt;/saying&gt;&lt;s aying id=&quot;12&quo t;
    author=&quot;Mi cah 4:6-7 (NKJV)&quot; phrase=&quot;&a mp;quot;In that
    day&amp;quot; says the Lord, &amp;quot;I will assemble the lame, I will
    gather the outcast, And those whom I have afflicted; I will make the
    lame a remnant, And the outcast a strong nation; So the Lord will reign
    over them in Mount Zion From now on, even
    forever.&amp;qu ot;&quot;&gt;&l t;/saying&gt;&lt;s aying id=&quot;13&quo t;
    author=&quot;Ed gar Allen Poe&quot; phrase=&quot;We are all insane with
    long intervals of sanity...&quot; &gt;&lt;/saying&gt;&lt;s aying
    id=&quot;14&quo t; author=&quot;C. S. Lewis&quot; phrase=&quot;At heism
    is simple. Real things are not
    simple.&quot;&g t;&lt;/saying&gt;&lt;s aying id=&quot;15&quo t;
    author=&quot;Ph il Powell&quot; phrase=&quot;Ni etzsche denied and mocked
    God, then died insane.. hmm..&quot;&gt; &lt;/saying&gt;&lt;s aying
    id=&quot;16&quo t; author=&quot;Ke ltin Alexander&quot; phrase=&quot;Ho w
    can you save those in darkness?
    You must be unafraid to enter the darkness, and let your light shine
    forth to every corner.
    &quot;&gt;&l t;/saying&gt;&lt;s aying id=&quot;17&quo t; author=&quot;Ph il
    in reply to &amp;quot;satan ists&amp;quot;& quot;
    phrase=&quot;&a mp;quot;..the serpent was created by a god that
    doesn&#034;t exist..&amp;quo t;.. Oh, so Satan doesn&#034;t exist
    either??!!&quot ;&gt;&lt;/saying&gt;&lt;s aying id=&quot;18&quo t;
    author=&quot;Ma tt&#034;s interpretation of &amp;quot;Screa ms of
    Abel&amp;quot;& quot; phrase=&quot;Ca in, no! Noo no please no!
    that&#034;s a really big rock Cain, nooooo, Mom won&#034;t like this a
    bit! owww Cain, now stop that! ouch! you hit like a girl, put that rock
    down right now little brother! owww&quot;&gt;& lt;/saying&gt;&lt;s aying
    id=&quot;19&quo t; author=&quot;ov erheard in chatroom&quot;
    phrase=&quot;5 out of 10 cannibals agree that vegetarians taste
    better..&quot;& gt;&lt;/saying&gt;&lt;s aying id=&quot;20&quo t;
    author=&quot;My London Family&quot; phrase=&quot;&a mp;quot;Thank you,
    please!&amp;quo t;&quot;&gt;&lt ;/saying&gt;&lt;s aying id=&quot;21&quo t;
    author=&quot;St .Augustine (354-430 AD)&quot; phrase=&quot;In
    Essentials, unity. In non-essentials, liberty. In all things,
    love&quot;&gt;& lt;/saying&gt;&lt;s aying id=&quot;22&quo t;
    author=&quot;On t-shirts in Norway&quot; phrase=&quot;I wear black
    until they invent a darker colour!!&quot;& gt;&lt;/saying&gt;&lt;s aying
    id=&quot;23&quo t; author=&quot;fr om &amp;quot;Dune& amp;quot;
    (1985)&quot; phrase=&quot;On e cannot go against the Word of
    God&quot;&gt;&l t;/saying&gt;&lt;/fortune&gt;
    "); } ?>' | /usr/local/bin/php >@stdout 2>&stderr<P>}
    Status: 404
    X-Powered-By: PHP/4.4.4
    Content-type: text/html

    No input file specified.
    child process exited abnormally

    I do not have "php -r" ability on any of my machines, so that is not an
    option. How then do you take PHP and pipe it into php.exe using CLI
    PHP without "-r"?

    Thanx
    Phil

  • Koncept

    #2
    Re: command-line PHP problem

    In article <1164481666.695 310.183780@l39g 2000cwd.googleg roups.com>,
    comp.lang.php <phillip.s.powe ll@gmail.comwro te:
    I am trying to pipe in some auto-generated PHP into php.exe, to no
    avail:
    >
    simple.&quot;&g t;&lt;/saying&gt;&lt;s aying id=&quot;15&quo t;
    author=&quot;Ph il Powell&quot; phrase=&quot;Ni etzsche denied and mocked
    God, then died insane.. hmm..&quot;&gt; &lt;/saying&gt;&lt;s aying
    "Nietzsche denied and mocked God, then died insane.. hmm.."

    A banana is green when picked, but turns brown with time... hmm..

    Just wait until Steve sees this thread. lol

    If you are using UNIX, have you tried using a cat to pipe to PHP?

    cat <<HERE | php
    stuff
    goes
    here
    HERE

    --
    Koncept <<
    "The snake that cannot shed its skin perishes. So do the spirits who are
    prevented from changing their opinions; they cease to be a spirit." -Nietzsche

    Comment

    • comp.lang.php

      #3
      Re: command-line PHP problem


      Koncept wrote:
      In article <1164481666.695 310.183780@l39g 2000cwd.googleg roups.com>,
      comp.lang.php <phillip.s.powe ll@gmail.comwro te:
      >
      I am trying to pipe in some auto-generated PHP into php.exe, to no
      avail:

      simple.&quot;&g t;&lt;/saying&gt;&lt;s aying id=&quot;15&quo t;
      author=&quot;Ph il Powell&quot; phrase=&quot;Ni etzsche denied and mocked
      God, then died insane.. hmm..&quot;&gt; &lt;/saying&gt;&lt;s aying
      >
      "Nietzsche denied and mocked God, then died insane.. hmm.."
      >
      A banana is green when picked, but turns brown with time... hmm..
      >
      Just wait until Steve sees this thread. lol
      >
      If you are using UNIX, have you tried using a cat to pipe to PHP?
      >
      cat <<HERE | php
      stuff
      goes
      here
      HERE
      Yes, and it kept giving me the error "input file not specified" when I
      did that too :( I wound up giving up and doing the whole thing
      entirely in TCL.

      Phil
      >
      --
      Koncept <<
      "The snake that cannot shed its skin perishes. So do the spirits who are
      prevented from changing their opinions; they cease to be a spirit." -Nietzsche

      Comment

      • J.O. Aho

        #4
        Re: command-line PHP problem

        comp.lang.php wrote:
        I am trying to pipe in some auto-generated PHP into php.exe, to no
        avail:
        In the man page for php it suggest you to use the -r option if you want to use
        code as a part of the argument.

        I do not have "php -r" ability on any of my machines, so that is not an
        option. How then do you take PHP and pipe it into php.exe using CLI
        PHP without "-r"?
        As you seems to use microsoft, maybe they have adjusted it to the microsofts
        way of things and uses /r, if you can't use that either, then you have to pipe
        the stream into a file which you then run, if that don't work, switch OS.



        //Aho

        Comment

        • comp.lang.php

          #5
          Re: command-line PHP problem


          J.O. Aho wrote:
          comp.lang.php wrote:
          I am trying to pipe in some auto-generated PHP into php.exe, to no
          avail:
          >
          In the man page for php it suggest you to use the -r option if you want to use
          code as a part of the argument.
          >
          >
          I do not have "php -r" ability on any of my machines, so that is not an
          option. How then do you take PHP and pipe it into php.exe using CLI
          PHP without "-r"?
          >
          As you seems to use microsoft, maybe they have adjusted it to the microsofts
          way of things and uses /r, if you can't use that either, then you have to pipe
          the stream into a file which you then run, if that don't work, switch OS.
          >
          Sorry no, I'm using Linux RHEL 4 on 2 machines and HP-UX on the other.
          None of them are Microsoft.

          Phil
          >
          >
          //Aho

          Comment

          • J.O. Aho

            #6
            Re: command-line PHP problem

            comp.lang.php wrote:
            J.O. Aho wrote:
            >comp.lang.ph p wrote:
            >>I am trying to pipe in some auto-generated PHP into php.exe, to no
            >>avail:
            >In the man page for php it suggest you to use the -r option if you want to use
            >code as a part of the argument.
            >>
            >>
            >>I do not have "php -r" ability on any of my machines, so that is not an
            >>option. How then do you take PHP and pipe it into php.exe using CLI
            >>PHP without "-r"?
            >As you seems to use microsoft, maybe they have adjusted it to the microsofts
            >way of things and uses /r, if you can't use that either, then you have to pipe
            >the stream into a file which you then run, if that don't work, switch OS.
            >>
            >
            Sorry no, I'm using Linux RHEL 4 on 2 machines and HP-UX on the other.
            None of them are Microsoft.
            In that case, don't use the php.exe but php.

            You can also try to generate '<?PHP' and '?>' around your code, and see if
            that helps you.


            //Aho

            Comment

            • comp.lang.php

              #7
              Re: command-line PHP problem


              J.O. Aho wrote:
              comp.lang.php wrote:
              J.O. Aho wrote:
              comp.lang.php wrote:
              >I am trying to pipe in some auto-generated PHP into php.exe, to no
              >avail:
              In the man page for php it suggest you to use the -r option if you want to use
              code as a part of the argument.
              >
              >
              >I do not have "php -r" ability on any of my machines, so that is not an
              >option. How then do you take PHP and pipe it into php.exe using CLI
              >PHP without "-r"?
              As you seems to use microsoft, maybe they have adjusted it to the microsofts
              way of things and uses /r, if you can't use that either, then you have to pipe
              the stream into a file which you then run, if that don't work, switch OS.
              >
              Sorry no, I'm using Linux RHEL 4 on 2 machines and HP-UX on the other.
              None of them are Microsoft.
              >
              In that case, don't use the php.exe but php.
              You completely confused me
              >
              You can also try to generate '<?PHP' and '?>' around your code, and see if
              that helps you.
              >
              >
              //Aho

              Comment

              Working...