Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #10156 > unrolled thread
| Started by | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| First post | 2013-07-20 12:00 +0100 |
| Last post | 2013-07-23 13:07 +0100 |
| Articles | 17 on this page of 37 — 11 participants |
Back to article view | Back to comp.lang.php
A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-20 12:00 +0100
Re: A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-20 12:40 +0100
Re: A curious thing...about tags. Tim Streater <timstreater@greenbee.net> - 2013-07-20 14:29 +0100
Re: A curious thing...about tags. Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-07-20 13:41 +0200
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-20 08:46 -0400
Re: A curious thing...about tags. Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-07-20 17:09 +0200
Re: A curious thing...about tags. Christoph Michael Becker <cmbecker69@arcor.de> - 2013-07-20 18:12 +0200
Re: A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-21 18:08 +0100
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-20 13:40 -0400
Re: A curious thing...about tags. Denis McMahon <denismfmcmahon@gmail.com> - 2013-07-20 18:33 +0000
Re: A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-21 18:14 +0100
Re: A curious thing...about tags. Richard Damon <Richard@Damon-Family.org> - 2013-07-21 14:31 -0400
Re: A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-21 20:35 +0100
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-21 18:21 -0400
Re: A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-22 08:47 +0100
Re: A curious thing...about tags. Tim Streater <timstreater@greenbee.net> - 2013-07-22 09:13 +0100
Re: A curious thing...about tags. "Alex vdB" <alex@invalid> - 2013-07-22 11:15 +0200
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-22 06:30 -0400
Re: A curious thing...about tags. "AvdB" <nomail@example.invalid> - 2013-07-23 00:13 +0200
Re: A curious thing...about tags. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-07-24 22:58 +0200
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-22 06:31 -0400
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-22 06:31 -0400
Re: A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-22 15:25 +0100
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-22 19:46 -0400
Re: A curious thing...about tags. Tim Streater <timstreater@greenbee.net> - 2013-07-22 17:41 +0100
Re: A curious thing...about tags. Denis McMahon <denismfmcmahon@gmail.com> - 2013-07-22 19:14 +0000
Re: A curious thing...about tags. Jerry Stuckle <jstucklex@attglobal.net> - 2013-07-22 17:00 -0400
Re: A curious thing...about tags. Denis McMahon <denismfmcmahon@gmail.com> - 2013-07-22 21:29 +0000
Re: A curious thing...about tags. Christoph Michael Becker <cmbecker69@arcor.de> - 2013-07-23 00:27 +0200
Re: A curious thing...about tags. Jerry Stuckle <jstucklex@attglobal.net> - 2013-07-22 19:27 -0400
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-22 19:56 -0400
Re: A curious thing...about tags. Jerry Stuckle <jstucklex@attglobal.net> - 2013-07-22 20:59 -0400
Re: A curious thing...about tags. The Natural Philosopher <tnp@invalid.invalid> - 2013-07-23 20:02 +0100
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-22 19:52 -0400
Re: A curious thing...about tags. Denis McMahon <denismfmcmahon@gmail.com> - 2013-07-23 09:40 +0000
Re: A curious thing...about tags. Norman Peelman <npeelman@cfl.rr.com> - 2013-07-23 06:22 -0400
Re: A curious thing...about tags. Tim Streater <timstreater@greenbee.net> - 2013-07-23 13:07 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2013-07-22 06:31 -0400 |
| Message-ID | <ksj19r$cqr$2@dont-email.me> |
| In reply to | #10172 |
On 07/22/2013 03:47 AM, The Natural Philosopher wrote: > On 21/07/13 23:21, Norman Peelman wrote: >> On 07/21/2013 03:35 PM, The Natural Philosopher wrote: >>> On 21/07/13 19:31, Richard Damon wrote: >>>> On 7/21/13 1:14 PM, The Natural Philosopher wrote: >>>>> On 20/07/13 19:33, Denis McMahon wrote: >>>>>> On Sat, 20 Jul 2013 17:09:37 +0200, Thomas Mlynarczyk wrote: >>>>>> >>>>>>> The Natural Philosopher schrieb: >>>>>>> >>>>>>>> suppose I want my string to be "?> something <?" >>>>>>>> How on earth is it possible to STOP PHP interpreting that as some >>>>>>>> blasted 'escape to outputting text' >>>>>>> Sorry, but I still don't quite see the problem. PHP will happily >>>>>>> accept >>>>>>> the above string as what it is: a simple string. It will not try to >>>>>>> interpret the <? or ?> contained within that string (why should >>>>>>> it?). >>>>>> Thomas, the problem is with the ability of the poster you are >>>>>> applying to >>>>>> to comprehend and understand string handling in php, and what his >>>>>> browser >>>>>> views as an element. >>>>>> >>>>>> Most of us understood the need to use < and why in html if we >>>>>> wanted a >>>>>> less than symbol within a few months at most of starting to use html. >>>>>> Some others will never understand it. >>>>> The problem is of course that you have totally failed to understand >>>>> the >>>>> problem I was in fact having. >>>>> >>>>> It has NOTHING to do with the browser. >>>>> The string output was never going anywhere NEAR a browser. >>>>> >>>>> The problem was how to CONSTRUCT a string using PHP, to put in a >>>>> file or >>>>> a database, that contain PHP escape sequences. >>>>> >>>>> Without. PHP interpreting them AS escape sequences. >>>>> >>>>> That is given the string $something, how to make >>>>> $new="?>".$something."<?"; >>>>> >>>>> without PHP instantly thinking you wanted to print $something on >>>>> stdout. >>>>> >>>>> >>>>>> Also, as you have noticed, the failure modes that some people post >>>>>> are >>>>>> not the failures that occur in the circumstances they describe. When >>>>>> you >>>>>> see this, you can usually assume that the person concerned does >>>>>> not, to >>>>>> use a common term, know their arse from their elbow. >>>>>> >>>>> Or in this case,.. the person his not bothered to understand the >>>>> actual >>>>> problem being described. >>>>> >>>>> >>>> The issue is that the PHP interpreter is defined to be smart enough >>>> that >>>> the ?> closing tag should NOT be recognized inside a quoted string the >>>> way you have stated. It is almost certainly some other problem. >>>> >>>> Can you post an EXACT COMPLETE example showing the problem and the >>>> output you get (view source on the page)? >>> I managed to get it to work, as I stated earlier.. >>> >>> This was the final code which works, hopefully not by some versional >>> quirk >>> >>> $run="?>".$run; >>> $run= $run."<?"; >>> >>> >>> >> >> If that works, then so should your original example... as well as: >> >> $run="?> $something <?"; >> >> Can you post an example of what wasn't working with output? And >> where the output is going? Cannot duplicate here. >> >> norman@amd64x2:~$ php -version >> PHP 5.3.2-1ubuntu4.19 with Suhosin-Patch (cli) (built: Mar 11 2013 >> 15:23:48) >> Copyright (c) 1997-2009 The PHP Group >> Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies >> >> norman@amd64x2:~$ php -a >> Interactive shell >> >> php > $something="my text"; >> php > $run="?> $something <?"; >> php > echo $run; >> ?> my text <? >> >> > In my setup that produces no output at all. > Mind you php -a doesnt produce any output from > php> echo "this"; > > either.. > > Nor even a command prompt > > It just sits there... > > > > Maybe this will help: http://php.net/manual/en/features.commandline.interactive.php -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2013-07-22 06:31 -0400 |
| Message-ID | <ksj1ah$cqr$3@dont-email.me> |
| In reply to | #10172 |
On 07/22/2013 03:47 AM, The Natural Philosopher wrote: > On 21/07/13 23:21, Norman Peelman wrote: >> On 07/21/2013 03:35 PM, The Natural Philosopher wrote: >>> On 21/07/13 19:31, Richard Damon wrote: >>>> On 7/21/13 1:14 PM, The Natural Philosopher wrote: >>>>> On 20/07/13 19:33, Denis McMahon wrote: >>>>>> On Sat, 20 Jul 2013 17:09:37 +0200, Thomas Mlynarczyk wrote: >>>>>> >>>>>>> The Natural Philosopher schrieb: >>>>>>> >>>>>>>> suppose I want my string to be "?> something <?" >>>>>>>> How on earth is it possible to STOP PHP interpreting that as some >>>>>>>> blasted 'escape to outputting text' >>>>>>> Sorry, but I still don't quite see the problem. PHP will happily >>>>>>> accept >>>>>>> the above string as what it is: a simple string. It will not try to >>>>>>> interpret the <? or ?> contained within that string (why should >>>>>>> it?). >>>>>> Thomas, the problem is with the ability of the poster you are >>>>>> applying to >>>>>> to comprehend and understand string handling in php, and what his >>>>>> browser >>>>>> views as an element. >>>>>> >>>>>> Most of us understood the need to use < and why in html if we >>>>>> wanted a >>>>>> less than symbol within a few months at most of starting to use html. >>>>>> Some others will never understand it. >>>>> The problem is of course that you have totally failed to understand >>>>> the >>>>> problem I was in fact having. >>>>> >>>>> It has NOTHING to do with the browser. >>>>> The string output was never going anywhere NEAR a browser. >>>>> >>>>> The problem was how to CONSTRUCT a string using PHP, to put in a >>>>> file or >>>>> a database, that contain PHP escape sequences. >>>>> >>>>> Without. PHP interpreting them AS escape sequences. >>>>> >>>>> That is given the string $something, how to make >>>>> $new="?>".$something."<?"; >>>>> >>>>> without PHP instantly thinking you wanted to print $something on >>>>> stdout. >>>>> >>>>> >>>>>> Also, as you have noticed, the failure modes that some people post >>>>>> are >>>>>> not the failures that occur in the circumstances they describe. When >>>>>> you >>>>>> see this, you can usually assume that the person concerned does >>>>>> not, to >>>>>> use a common term, know their arse from their elbow. >>>>>> >>>>> Or in this case,.. the person his not bothered to understand the >>>>> actual >>>>> problem being described. >>>>> >>>>> >>>> The issue is that the PHP interpreter is defined to be smart enough >>>> that >>>> the ?> closing tag should NOT be recognized inside a quoted string the >>>> way you have stated. It is almost certainly some other problem. >>>> >>>> Can you post an EXACT COMPLETE example showing the problem and the >>>> output you get (view source on the page)? >>> I managed to get it to work, as I stated earlier.. >>> >>> This was the final code which works, hopefully not by some versional >>> quirk >>> >>> $run="?>".$run; >>> $run= $run."<?"; >>> >>> >>> >> >> If that works, then so should your original example... as well as: >> >> $run="?> $something <?"; >> >> Can you post an example of what wasn't working with output? And >> where the output is going? Cannot duplicate here. >> >> norman@amd64x2:~$ php -version >> PHP 5.3.2-1ubuntu4.19 with Suhosin-Patch (cli) (built: Mar 11 2013 >> 15:23:48) >> Copyright (c) 1997-2009 The PHP Group >> Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies >> >> norman@amd64x2:~$ php -a >> Interactive shell >> >> php > $something="my text"; >> php > $run="?> $something <?"; >> php > echo $run; >> ?> my text <? >> >> > In my setup that produces no output at all. > Mind you php -a doesnt produce any output from > php> echo "this"; > > either.. > > Nor even a command prompt > > It just sits there... > > Well, then how are you 'running' your code? You show a command prompt above. The interactive shell executes each line as you type it in. I can't even imagine what your setup is without you telling. -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-07-22 15:25 +0100 |
| Message-ID | <ksjfc4$mib$2@news.albasani.net> |
| In reply to | #10177 |
On 22/07/13 11:31, Norman Peelman wrote: > On 07/22/2013 03:47 AM, The Natural Philosopher wrote: >> In my setup that produces no output at all. >> Mind you php -a doesnt produce any output from >> php> echo "this"; >> >> either.. >> >> Nor even a command prompt >> >> It just sits there... >> >> > > Well, then how are you 'running' your code? You show a command > prompt above. The interactive shell executes each line as you type it > in. I can't even imagine what your setup is without you telling. > > Shrug. I dunno. I merely tries to replaicate te test $ php -a Interactive mode enabled <? Echo "sodit"; ?> echo "sodit"; Sodit ^C $ -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2013-07-22 19:46 -0400 |
| Message-ID | <kskfti$o08$1@dont-email.me> |
| In reply to | #10178 |
On 07/22/2013 10:25 AM, The Natural Philosopher wrote: > On 22/07/13 11:31, Norman Peelman wrote: >> On 07/22/2013 03:47 AM, The Natural Philosopher wrote: >>> In my setup that produces no output at all. >>> Mind you php -a doesnt produce any output from >>> php> echo "this"; >>> >>> either.. >>> >>> Nor even a command prompt >>> >>> It just sits there... >>> >>> >> >> Well, then how are you 'running' your code? You show a command >> prompt above. The interactive shell executes each line as you type it >> in. I can't even imagine what your setup is without you telling. >> >> > Shrug. I dunno. I merely tries to replaicate te test > > $ php -a > Interactive mode enabled > > <? > Echo "sodit"; > ?> > > echo "sodit"; > Sodit > ^C > $ > You are in 'Interactive Mode', not 'Interactive Shell'. You just need to type (press enter after each line): $ php -a Interactive mode enabled <?php echo "?> something <?"; ?> press CTRL-D (or Z maybe) --- It's a compilation option --with-readline (or lack of) that causes it to revert to this mode. I don't feel like compiling PHP just to find out. Give it a go. -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2013-07-22 17:41 +0100 |
| Message-ID | <timstreater-12E6C6.17411322072013@news.individual.net> |
| In reply to | #10177 |
In article <ksj1ah$cqr$3@dont-email.me>, Norman Peelman <npeelman@cfl.rr.com> wrote: > On 07/22/2013 03:47 AM, The Natural Philosopher wrote: > >> Interactive shell > >> > >> php > $something="my text"; > >> php > $run="?> $something <?"; > >> php > echo $run; > >> ?> my text <? > > In my setup that produces no output at all. > > Mind you php -a doesnt produce any output from > > php> echo "this"; > > > > either.. > > > > Nor even a command prompt > > > > It just sits there... > Well, then how are you 'running' your code? You show a command prompt > above. The interactive shell executes each line as you type it in. I > can't even imagine what your setup is without you telling. Then get a clue. TNP uses PHP at the command line with: php -a He then enters: echo "this"; at the prompt, and it hangs. There. That wasn't too hard to figure out, was it. -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-07-22 19:14 +0000 |
| Message-ID | <ksk0aa$2gv$1@dont-email.me> |
| In reply to | #10180 |
On Mon, 22 Jul 2013 17:41:13 +0100, Tim Streater wrote: > Then get a clue. TNP uses PHP at the command line with: > > php -a > > He then enters: > > echo "this"; > > at the prompt, and it hangs. There. That wasn't too hard to figure out, > was it. Then it's something in his configuration that's different to my command line configuration. -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-07-22 17:00 -0400 |
| Message-ID | <ksk64n$1pf$1@dont-email.me> |
| In reply to | #10182 |
On 7/22/2013 3:14 PM, Denis McMahon wrote: > On Mon, 22 Jul 2013 17:41:13 +0100, Tim Streater wrote: > >> Then get a clue. TNP uses PHP at the command line with: >> >> php -a >> >> He then enters: >> >> echo "this"; >> >> at the prompt, and it hangs. There. That wasn't too hard to figure out, >> was it. > > Then it's something in his configuration that's different to my command > line configuration. > Works the same for me as it did for Tim. Maybe you hit ctrl-Z (or ctrl-D on linux)? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-07-22 21:29 +0000 |
| Message-ID | <ksk886$2gv$2@dont-email.me> |
| In reply to | #10184 |
On Mon, 22 Jul 2013 17:00:00 -0400, Jerry Stuckle wrote: > On 7/22/2013 3:14 PM, Denis McMahon wrote: >> On Mon, 22 Jul 2013 17:41:13 +0100, Tim Streater wrote: >> >>> Then get a clue. TNP uses PHP at the command line with: >>> >>> php -a >>> >>> He then enters: >>> >>> echo "this"; >>> >>> at the prompt, and it hangs. There. That wasn't too hard to figure >>> out, >>> was it. >> >> Then it's something in his configuration that's different to my command >> line configuration. >> >> > Works the same for me as it did for Tim. > > Maybe you hit ctrl-Z (or ctrl-D on linux)? Nope, I did the following as Tim posted, starting from a shell prompt: php -a echo "this"; And what appears on my screen is this: $ php -a Interactive shell php > echo "this"; this php > exit $ So if TNPs system is hanging after he enters the 'echo "this";' then my bet is that it's something he did to his configuration. -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Christoph Michael Becker <cmbecker69@arcor.de> |
|---|---|
| Date | 2013-07-23 00:27 +0200 |
| Message-ID | <51edb167$0$9503$9b4e6d93@newsspool1.arcor-online.net> |
| In reply to | #10185 |
Denis McMahon wrote: > So if TNPs system is hanging after he enters the 'echo "this";' then my > bet is that it's something he did to his configuration. That's the difference between interactive *shell* and interactive *mode* (see <http://php.net/manual/en/features.commandline.interactive.php>). Giving a proper --with-readline option to the build process might not always suffice (at least I was not able to compile PHP, so that it offers the interactive shell, under Cygwin). -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-07-22 19:27 -0400 |
| Message-ID | <kskeod$j61$1@dont-email.me> |
| In reply to | #10185 |
On 7/22/2013 5:29 PM, Denis McMahon wrote: > On Mon, 22 Jul 2013 17:00:00 -0400, Jerry Stuckle wrote: > >> On 7/22/2013 3:14 PM, Denis McMahon wrote: >>> On Mon, 22 Jul 2013 17:41:13 +0100, Tim Streater wrote: >>> >>>> Then get a clue. TNP uses PHP at the command line with: >>>> >>>> php -a >>>> >>>> He then enters: >>>> >>>> echo "this"; >>>> >>>> at the prompt, and it hangs. There. That wasn't too hard to figure >>>> out, >>>> was it. >>> >>> Then it's something in his configuration that's different to my command >>> line configuration. >>> >>> >> Works the same for me as it did for Tim. >> >> Maybe you hit ctrl-Z (or ctrl-D on linux)? > > Nope, I did the following as Tim posted, starting from a shell prompt: > > php -a > echo "this"; > > And what appears on my screen is this: > > $ php -a > Interactive shell > > php > echo "this"; > this > php > exit > $ > > So if TNPs system is hanging after he enters the 'echo "this";' then my > bet is that it's something he did to his configuration. > What I get in both Windows and Linux is: C:\>php -a Interactive mode enabled echo "this"; Then after doing ctrl-Z (ctrl-D in Linux) echo "this"; I could check through the php.ini options to see what affects this, but considering the source of the problem, I really don't care. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2013-07-22 19:56 -0400 |
| Message-ID | <kskgfg$qb3$1@dont-email.me> |
| In reply to | #10188 |
On 07/22/2013 07:27 PM, Jerry Stuckle wrote: > On 7/22/2013 5:29 PM, Denis McMahon wrote: >> On Mon, 22 Jul 2013 17:00:00 -0400, Jerry Stuckle wrote: >> >>> On 7/22/2013 3:14 PM, Denis McMahon wrote: >>>> On Mon, 22 Jul 2013 17:41:13 +0100, Tim Streater wrote: >>>> >>>>> Then get a clue. TNP uses PHP at the command line with: >>>>> >>>>> php -a >>>>> >>>>> He then enters: >>>>> >>>>> echo "this"; >>>>> >>>>> at the prompt, and it hangs. There. That wasn't too hard to figure >>>>> out, >>>>> was it. >>>> >>>> Then it's something in his configuration that's different to my command >>>> line configuration. >>>> >>>> >>> Works the same for me as it did for Tim. >>> >>> Maybe you hit ctrl-Z (or ctrl-D on linux)? >> >> Nope, I did the following as Tim posted, starting from a shell prompt: >> >> php -a >> echo "this"; >> >> And what appears on my screen is this: >> >> $ php -a >> Interactive shell >> >> php > echo "this"; >> this >> php > exit >> $ >> >> So if TNPs system is hanging after he enters the 'echo "this";' then my >> bet is that it's something he did to his configuration. >> > > What I get in both Windows and Linux is: > > C:\>php -a > Interactive mode enabled > > echo "this"; > > Then after doing ctrl-Z (ctrl-D in Linux) > > echo "this"; > > I could check through the php.ini options to see what affects this, but > considering the source of the problem, I really don't care. > I do believe you need to use proper starting and ending tags. You're output indicates PHP has simply passed-thru the text you entered. But yes CTRL-D or Z maybe should be the proper way to 'run' the code in Interactive *Mode* -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-07-22 20:59 -0400 |
| Message-ID | <kskk68$9k8$1@dont-email.me> |
| In reply to | #10191 |
On 7/22/2013 7:56 PM, Norman Peelman wrote: > On 07/22/2013 07:27 PM, Jerry Stuckle wrote: >> On 7/22/2013 5:29 PM, Denis McMahon wrote: >>> On Mon, 22 Jul 2013 17:00:00 -0400, Jerry Stuckle wrote: >>> >>>> On 7/22/2013 3:14 PM, Denis McMahon wrote: >>>>> On Mon, 22 Jul 2013 17:41:13 +0100, Tim Streater wrote: >>>>> >>>>>> Then get a clue. TNP uses PHP at the command line with: >>>>>> >>>>>> php -a >>>>>> >>>>>> He then enters: >>>>>> >>>>>> echo "this"; >>>>>> >>>>>> at the prompt, and it hangs. There. That wasn't too hard to figure >>>>>> out, >>>>>> was it. >>>>> >>>>> Then it's something in his configuration that's different to my >>>>> command >>>>> line configuration. >>>>> >>>>> >>>> Works the same for me as it did for Tim. >>>> >>>> Maybe you hit ctrl-Z (or ctrl-D on linux)? >>> >>> Nope, I did the following as Tim posted, starting from a shell prompt: >>> >>> php -a >>> echo "this"; >>> >>> And what appears on my screen is this: >>> >>> $ php -a >>> Interactive shell >>> >>> php > echo "this"; >>> this >>> php > exit >>> $ >>> >>> So if TNPs system is hanging after he enters the 'echo "this";' then my >>> bet is that it's something he did to his configuration. >>> >> >> What I get in both Windows and Linux is: >> >> C:\>php -a >> Interactive mode enabled >> >> echo "this"; >> >> Then after doing ctrl-Z (ctrl-D in Linux) >> >> echo "this"; >> >> I could check through the php.ini options to see what affects this, but >> considering the source of the problem, I really don't care. >> > > I do believe you need to use proper starting and ending tags. You're > output indicates PHP has simply passed-thru the text you entered. But > yes CTRL-D or Z maybe should be the proper way to 'run' the code in > Interactive *Mode* > > > I agree with the tags - I've always used them when testing. Here, I was entering the text exactly as Dennis did, and showing I did NOT get the results he did. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-07-23 20:02 +0100 |
| Message-ID | <ksmk0u$s8h$9@news.albasani.net> |
| In reply to | #10185 |
On 22/07/13 22:29, Denis McMahon wrote: > On Mon, 22 Jul 2013 17:00:00 -0400, Jerry Stuckle wrote: > >> On 7/22/2013 3:14 PM, Denis McMahon wrote: >>> On Mon, 22 Jul 2013 17:41:13 +0100, Tim Streater wrote: >>> >>>> Then get a clue. TNP uses PHP at the command line with: >>>> >>>> php -a >>>> >>>> He then enters: >>>> >>>> echo "this"; >>>> >>>> at the prompt, and it hangs. There. That wasn't too hard to figure >>>> out, >>>> was it. >>> Then it's something in his configuration that's different to my command >>> line configuration. >>> >>> >> Works the same for me as it did for Tim. >> >> Maybe you hit ctrl-Z (or ctrl-D on linux)? > Nope, I did the following as Tim posted, starting from a shell prompt: > > php -a > echo "this"; > > And what appears on my screen is this: > > $ php -a > Interactive shell > > php > echo "this"; > this > php > exit > $ > > So if TNPs system is hanging after he enters the 'echo "this";' then my > bet is that it's something he did to his configuration. > I have never configured PHP to use a shell at all. It is a vanilla debian stable installation. -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2013-07-22 19:52 -0400 |
| Message-ID | <kskg7s$pco$1@dont-email.me> |
| In reply to | #10180 |
On 07/22/2013 12:41 PM, Tim Streater wrote: > In article <ksj1ah$cqr$3@dont-email.me>, > Norman Peelman <npeelman@cfl.rr.com> wrote: > >> On 07/22/2013 03:47 AM, The Natural Philosopher wrote: > >> >> Interactive shell >> >> >> >> php > $something="my text"; >> >> php > $run="?> $something <?"; >> >> php > echo $run; >> >> ?> my text <? > >> > In my setup that produces no output at all. >> > Mind you php -a doesnt produce any output from >> > php> echo "this"; >> > >> > either.. >> > >> > Nor even a command prompt >> > >> > It just sits there... > >> Well, then how are you 'running' your code? You show a command >> prompt above. The interactive shell executes each line as you type it >> in. I can't even imagine what your setup is without you telling. > > Then get a clue. TNP uses PHP at the command line with: > > php -a > > He then enters: > > echo "this"; > > at the prompt, and it hangs. There. That wasn't too hard to figure out, > was it. > It's not hanging, but waiting for proper EOF. But also probably needs proper starting and ending tags as well. <?php echo "?> something <?"; ?> CTRL-D (or Z maybe) -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-07-23 09:40 +0000 |
| Message-ID | <kslj24$su3$1@dont-email.me> |
| In reply to | #10190 |
On Mon, 22 Jul 2013 19:52:14 -0400, Norman Peelman wrote: > It's not hanging, but waiting for proper EOF. But also probably needs > proper starting and ending tags as well. > <?php echo "?> something <?"; > ?> > CTRL-D (or Z maybe) Not in my setup: Starting at a command shell, the only things I type are the following 3 lines: php -a echo "this"; exit What appears on my console are the following 7 lines: $ php -a Interactive shell php > echo "this"; this php > exit $ -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2013-07-23 06:22 -0400 |
| Message-ID | <ksll5r$lgi$1@dont-email.me> |
| In reply to | #10194 |
On 07/23/2013 05:40 AM, Denis McMahon wrote: > On Mon, 22 Jul 2013 19:52:14 -0400, Norman Peelman wrote: > >> It's not hanging, but waiting for proper EOF. But also probably needs >> proper starting and ending tags as well. > >> <?php echo "?> something <?"; >> ?> >> CTRL-D (or Z maybe) > > Not in my setup: > > Starting at a command shell, the only things I type are the following 3 > lines: > > php -a > echo "this"; > exit > > What appears on my console are the following 7 lines: > > $ php -a > Interactive shell > > php > echo "this"; > this > php > exit > $ > Dennis, You and I have the 'Interactive *SHELL*' and that is the way it is supposed to work. 'Interactive *MODE* is something different. You can't pick which one you use at the terminal. http://php.net/manual/en/features.commandline.interactive.php "Interactive *MODE* is essentially like running php with stdin as the file input. You just type code, and when you're done (Ctrl-D), php executes whatever you typed as if it were a normal PHP (PHTML) file - hence you start in interactive *mode* with '<?php' in order to execute code." http://www.php.net/manual/en/features.commandline.interactive.php#108006 https://bugs.php.net/bug.php?id=60683 It's not a bug, read the history down to the bottom. -- Norman Registered Linux user #461062 -Have you been to www.php.net yet?-
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2013-07-23 13:07 +0100 |
| Message-ID | <timstreater-BC206D.13070923072013@news.individual.net> |
| In reply to | #10194 |
In article <kslj24$su3$1@dont-email.me>, Denis McMahon <denismfmcmahon@gmail.com> wrote: > On Mon, 22 Jul 2013 19:52:14 -0400, Norman Peelman wrote: > > > It's not hanging, but waiting for proper EOF. But also probably needs > > proper starting and ending tags as well. > > > <?php echo "?> something <?"; > > ?> > > CTRL-D (or Z maybe) > > Not in my setup: > > Starting at a command shell, the only things I type are the following 3 > lines: > > php -a > echo "this"; > exit > > What appears on my console are the following 7 lines: > > $ php -a > Interactive shell > > php > echo "this"; > this > php > exit > $ Exactly what I observe (OS X). -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.php
csiph-web