php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60683 Interactive Mode doesn't reach prompt
Submitted: 2012-01-08 05:31 UTC Modified: 2012-03-06 01:56 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: davey@php.net Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.4.0RC5 OS: OSX 10.7.2 & Ubuntu 11.04
Private report: No CVE-ID: None
 [2012-01-08 05:31 UTC] davey@php.net
Description:
------------
* Using OS X Lion 10.7.2 or Ubuntu 11.04 (Natty), and basic "./configure".

If you run php -a, you never reach the prompt, and nothing entered will work. All 
you can do is ^C to kill it.

Setting cli.prompt does not help.

Test script:
---------------
$ php -a

Expected result:
----------------
$ php -a
Interactive mode enabled

php > 

Actual result:
--------------
$ php -a
Interactive mode enabled

(wait. wait. wait.)

^C


Backtrace if helpful:
#0  0x00007fff87f6ad52 in read$NOCANCEL ()
#1  0x00007fff86883c25 in _sread ()
#2  0x00007fff86884166 in __srefill1 ()
#3  0x00007fff86884cb2 in __fread ()
#4  0x00007fff86884b34 in fread ()
#5  0x000000010028744c in zend_stream_getc [inlined] () at /Users/davey/src/php-
5.4.0RC5/Zend/zend_stream.c:148
#6  0x000000010028744c in zend_stream_read (file_handle=0x0, buf=0x1009356a0 "?
V?", len=4096) at zend_stream.c:168
#7  0x00000001002878fb in zend_stream_fixup (file_handle=0x0, buf=0x7fff5fbfecc0, 
len=0x7fff5fbfecb8) at zend_stream.c:262
#8  0x00000001002493be in open_file_for_scanning (file_handle=0x7fff5fbff958) at 
zend_language_scanner.l:483
#9  0x000000010024a190 in compile_file (file_handle=0x7fff5fbff958, type=8) at 
zend_language_scanner.l:566
#10 0x0000000100159ba2 in phar_compile_file (file_handle=0x0, type=1606414144) at 
phar.c:3391
#11 0x0000000100272b57 in zend_execute_scripts (type=8, retval=0x7fff5fbff0a0, 
file_count=1606414496) at zend.c:1264
#12 0x00000001002170e2 in php_execute_script (primary_file=0x7fff5fbff958) at 
main.c:2476
#13 0x00000001002ff3e5 in do_cli [inlined] () at /Users/davey/src/php-
5.4.0RC5/sapi/cli/php_cli.c:983
#14 0x00000001002ff3e5 in main (argc=1606417184, argv=0x0) at php_cli.c:1356

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-08 05:37 UTC] dragoonis@php.net
I confirmed this case with davey on Mac OSX Lion

Darwin Paul-Dragooniss-MacBook-Pro.local 11.2.0 Darwin Kernel Version 11.2.0: Tue 
Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
05:10
macosx lion..


My build details are:
--
bash-3.2$ ../build/bin/php -v
PHP 5.4.0RC6-dev (cli) (built: Jan  8 2012 03:03:04) (DEBUG)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

Thanks.
 [2012-01-13 21:45 UTC] rk at srsbiz dot pl
IMHO it's not a bug, to have interactive shell you have to configure with readline support, not just clean './configure'
 [2012-01-15 01:58 UTC] dragoonis@php.net
@rk,

If there's support required for another library then it shouldn't let you enter 
interactive mode, and back out, giving you a useful error message to tell you 
there are missing dependencies..
 [2012-01-16 19:18 UTC] rk at srsbiz dot pl
@dragoonis 

readline is only required to make this mode truly interactive (with command history, function completion etc), but it also works without it. You can type/paste your code and it will be executed as soon as EOF (^D) is reached, so it's rather documentation problem.
 [2012-01-17 18:30 UTC] davey@php.net
Can we make the output here 
(http://lxr.php.net/opengrok/xref/PHP_5_4/sapi/cli/php_cli.c#906) be a little 
more descriptive?

i.e.:

printf("Interactive mode enabled\n");
printf("No readline/libedit support, use ^D to execute and quit.\n\n");
 [2012-03-06 01:56 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The classic interactive mode is different from the shell mode, just re-using the flag.
 [2012-03-06 01:56 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jun 03 00:01:27 2020 UTC