igor_g
March 15, 2021, 10:30pm
1
I try to use readline functions and see the error message that some of them are undefined.
Strange that function readline()
exists, but another functions, e.g. readline_callback_handler_install()
or readline_callback_read_char()
- not.
Screenshot from my phpinfo()
below…
I guess having this enabled is different than having PHP built with readline in it. They talk a bit about this in the following post…
opened 07:59PM - 09 Dec 09 UTC
closed 10:04PM - 11 Dec 09 UTC
bug
I have readline installed, not sure why I am getting an undefined function call.… System information and command output is below.
<pre>
$ php -v
PHP 5.2.11 (cli) (built: Nov 17 2009 19:18:54)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with the ionCube PHP Loader v3.3.1, Copyright (c) 2002-2009, by ionCube Ltd., and
with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans
</pre>
<pre>
$ uname -a
Linux eric-desktop.local 2.6.30.9-102.fc11.x86_64 #1 SMP Fri Dec 4 00:18:53 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
</pre>
<pre><code>
$ ./iphp
Welcome to iphp, the interactive php shell!
Features include:
- autocomplete (tab key)
- readline support w/history
- automatically wired into your project's autoload
Enter a php statement at the prompt, and it will be evaluated. The variable $_ will contain the result.
Example:
> new ArrayObject(array(1,2))
ArrayObject Object
(
[0] => 1
[1] => 2
)
> $_[0] + 1
2
PHP Fatal error: Call to undefined function readline_callback_handler_install() in /home/eric/Source/iphp/iphp.php on line 191
PHP Stack trace:
PHP 1. {main}() /home/eric/Source/iphp/iphp:0
PHP 2. iphp::main($options = array ()) /home/eric/Source/iphp/iphp:7
PHP 3. iphp->readline() /home/eric/Source/iphp/iphp.php:276
PHP 4. iphp->myReadline() /home/eric/Source/iphp/iphp.php:209
Fatal error: Call to undefined function readline_callback_handler_install() in /home/eric/Source/iphp/iphp.php on line 191
Call Stack:
0.0006 94752 1. {main}() /home/eric/Source/iphp/iphp:0
0.0031 203216 2. iphp::main(array ()) /home/eric/Source/iphp/iphp:7
0.0291 755904 3. iphp->readline() /home/eric/Source/iphp/iphp.php:276
0.0291 755904 4. iphp->myReadline() /home/eric/Source/iphp/iphp.php:209
</code></pre>
What does the configure line look like? Does it have the option to include readline?
igor_g
March 15, 2021, 11:50pm
3
I have Windows 10 / XAMPP 7.2.34. It needs no command line instalation.
Perhaps that is the problem. It may just not be included with XAMPP. I can’t find any recent stuff saying if it is included or not, but old resources say that XAMPP doesn’t include readline built into the underlying PHP.
Again it may need not just be enabled, but also built into the PHP.
igor_g
March 16, 2021, 7:59am
5
Okey, what should I do to fix it?
Below my info about readline extension. There is no readline_callback_...
functions in.
Well if the resources are to be believed, you need to do a straight install of PHP where you can install readline as a config option . Looks like you will need at least PHP 7.1 to use it on windows (just in case you were running an earlier version).
I would start with installation documentation…
https://www.php.net/manual/en/book.readline.php
And just work through the process.
igor_g
March 16, 2021, 4:48pm
7
I’ve tried php --with-libedit=C:\xampp\php\ext\libedit
This brings nothing. And in libedit I found instruction:
cd' to the directory containing the package's source code and type
./configure’ to configure the package for your system. If you’re
using csh' on an old version of System V, you might need to type
sh ./configure’ instead to prevent csh' from trying to execute
configure’ itself.
Running `configure’ takes awhile. While running, it prints some
messages telling which features it is checking for.
…
What exactlyshould I do by Windows / XAMPP?
system
Closed
June 15, 2021, 11:49pm
8
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.