|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51695 CLI interactive mode broken without readline/editline
Submitted: 2010-04-29 12:07 UTC Modified: 2020-10-07 12:44 UTC
Avg. Score:4.5 ± 0.6
Reproduced:32 of 32 (100.0%)
Same Version:14 (43.8%)
Same OS:11 (34.4%)
From: IMadeThisUpForBugzilla at yahoo dot com Assigned:
Status: Verified Package: CGI/CLI related
PHP Version: master OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-04-29 12:07 UTC] IMadeThisUpForBugzilla at yahoo dot com
Run php at the command line in Windows in interactive mode (php -a), echo something, nothing happens until the process is ended (see test script for example command line session). Doesn't work in PHP 5.3.X. Does work in PHP 5.2.X.

Tried Zend build, version shipped with eclipse, and version distributed on VC6 and VC9.

Test script:
c:\php> .\php.exe -an
Interactive mode enabled

echo 'hi';

Expected result:
Session example included. Should output the string 'hi' to the console after "echo 'hi';" (this is correct in PHP 5.2.X)

Actual result:
Nothing output after executing "echo 'hi';" line. See test script for example session at command line.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-02 00:35 UTC]
-Summary: CLI interactive output not displayed +Summary: CLI interactive mode broken without readline/editline
 [2010-05-02 00:35 UTC]
This can be reproduced by building the CLI SAPI without readline/editline support (like we currently do at Debian because of an editline bug.)

One has to send an EOF so that the input is processed, but one can not do anything afterwards: php exits.
 [2010-08-18 13:19 UTC] peter at niederlag dot de
unfortunatly as of now this makes the interactive shell mostly useless for debian users. :-<
 [2012-08-31 15:25 UTC] luis dot pessoa67 at ibest dot com dot br
This code works fine:

(tag ?> missing)

c:\php> .\php.exe -an
Interactive mode enabled

echo 'hi';
 [2013-08-01 23:25 UTC]
-Status: Open +Status: Verified -Operating System: Windows XP SP 3 +Operating System: any -PHP Version: 5.3.2 +PHP Version: master
 [2013-08-01 23:25 UTC]
May be we should print error & exit when readline/editline is not available.
 [2013-08-01 23:25 UTC]
May be we should print error & exit when readline/editline is not available.
 [2015-08-17 04:56 UTC] lb1 dot 3 at juno dot com
This is still not working in PHP7-nightly Zend package and Ubuntu 14.04, but works ok with the standard Ubuntu-PHP.
 [2015-10-16 19:08 UTC] bugs dot php dot net at majkl578 dot cz
Confirmed, still broken in PHP 7.0.0RC5 on Linux.
 [2020-10-07 12:44 UTC]
-Type: Bug +Type: Documentation Problem
 [2020-10-07 12:44 UTC]
This works as expected; without readline you have the "interactive
mode" which works differently from the "interactive shell".  In
interactive mode you have to type a complete PHP script, and
afterwards to press CRTL+d (POSIX) or CTRL+z followed by ENTER
(Windows) to evaluate the script.  See user note 108006 for
further details.

The only thing that is suboptimal, is that the message reporting
whether the interactive shell or the interactive mode would be
enabled, is compiled statically what may lead to erroneous info.
You still can distinguish interactive mode/shell, because only for
the latter the prompt ("php >") is shown.

[1] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Aug 03 05:01:23 2021 UTC