How to solve Fatal error: Call to undefined function readline()? readline library not found?

Posted by SirBT on Ask Ubuntu See other posts from Ask Ubuntu or by SirBT
Published on 2012-09-01T17:16:34Z Indexed on 2012/09/01 21:49 UTC
Read the original article Hit count: 177

Filed under:
|

I have an Ubuntu 12.04 LTS. And XAMPP for linux 1.7.7.

When I code in php with and call the readline function I get this error message? "Fatal error: Call to undefined function readline()"

I recently found the below thread which pointed out the name of the package that contained the desired readline: How to solve configure: error: readline library not found?

I went ahead and installed # apt-get install libreadline6. But this didnt seem to make a difference. I still get the same error message: "Fatal error: Call to undefined function readline()". Was the thread missing further steps? Can anyone help me?

I am new to Ubuntu.

<?php

echo "Simple menu \n" ;

echo "1. Play Sports \n";
echo "2. Play Strategy games \n";

$userInput = readline('Enter something here: ');

?>

© Ask Ubuntu or respective owner

Related posts about php

Related posts about xampp