php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51695 CLI interactive mode broken without readline/editline
Submitted: 2010-04-29 12:07 UTC Modified: 2013-08-01 23:25 UTC
Votes:35
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
Description:
------------
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 windows.php.net VC6 and VC9.

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

<?php
echo 'hi';
^Z
hi
c:\php> 


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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-02 00:35 UTC] geissert@php.net
-Summary: CLI interactive output not displayed +Summary: CLI interactive mode broken without readline/editline
 [2010-05-02 00:35 UTC] geissert@php.net
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

<?php
echo 'hi';
?>
^Z
hi
c:\php>
 [2013-08-01 23:25 UTC] yohgaki@php.net
-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] yohgaki@php.net
May be we should print error & exit when readline/editline is not available.
 [2013-08-01 23:25 UTC] yohgaki@php.net
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.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC