|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-02-21 17:47 UTC] admin at mateuszjanowski dot pl
Description: ------------ Hello, is my first bug report; I'm using php compiler (phc - http://www.phpcompiler.org/) with php CLI [5.2.8]. I meet first problem when i started to use readline extension. I compiled php with '--with readline' is working ok but when i compile my program using phc i get; 'Fatal error: status(): Call to undefined function readline() in rcon.php on line 52'. The phc author tell me to do; "I would recommend filing a bug with PHP, asking for the readline extension to be included in the embed SAPI. It seems like an oversight rather than a feature. In addition, it might be straightforward to create a patch to fix this yourself. I took a quick look at this, but I couldn't find where to do this. You might have more luck." Btw i compiled PHP 5.2.9RC2 version and getting the same error. Mabye you can help me? Greetings Mateusz Janowski. Reproduce code: --------------- http://mateuszjanowski.pl/rcon.phps Expected result: ---------------- 0.2 Alpha - www.torvalds.pl Remote Console: IP:PORT... Rcon: <You write here commands which is send to the server.> Actual result: -------------- When i run php -f rcon.php is working OK but after compiling nope; 0.2 Alpha - www.torvalds.pl Remote Console: IP:PORT... Fatal error: status(): Call to undefined function readline() in rcon.php on line 52 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 07:00:01 2025 UTC |
I believe this also applies to ncurses, pcntl, and libedit. Here is a patch to fix it: --- aclocal.m4.orig 2009-04-25 13:11:57.000000000 +0100 +++ aclocal.m4 2009-04-25 13:24:50.000000000 +0100 @@ -962,7 +962,7 @@ if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then dnl ---------------------------------------------- CLI static module [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no - if test "$PHP_SAPI" = "cgi"; then + if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "embed"; then PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,) EXT_STATIC="$EXT_STATIC $1" else I tested it by building PHP 5.2.6, 5.2.9 and php5.3-200902131730, building with ./configure --enable-embed --with-readline --enable-pcntl --with-ncurses and running nm .libs/libphp5.so | grep readline (and similarly for pcntl and ncurses) which verifies that the readline symbols are available. I also ran the test script from Mateusz through phc, and observed that calls to readline now succeeded. Can the patch be considered for 5.2.10, 5.3 and HEAD?