Call to undefined function readline()?

假如想象 提交于 2019-12-05 04:34:28

Or just use this to simulate it

if(!function_exists("readline")) {
    function readline($prompt = null){
        if($prompt){
            echo $prompt;
        }
        $fp = fopen("php://stdin","r");
        $line = rtrim(fgets($fp, 1024));
        return $line;
    }
}
David

readline() is for running on the command line not via the web browser.

To check you have it installed on your server, type:

php -i | grep Configure

Probably, you have not installed it and you should compile it yourself or ask your hosting admin to if they allow this.

bcmcfc

Just had this issue on Ubuntu.

Found this answer: https://askubuntu.com/a/264329/166

The solution in this scenario was to install the package php5-readline.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!