Fatal Error Call To Undefined Function Readline In
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Call to undefined function readline()? up vote 4 down vote favorite 1 I am integrating Dropbox into my PHP based website. When i try to run the following code. i got this Fatal error: Call to undefined function readline() on the last line. require_once "dropbox-sdk/Dropbox/autoload.php"; use \Dropbox as dbx; $appInfo = dbx\AppInfo::loadFromJsonFile("app-info.json"); echo "
"; print_r($appInfo); echo ""; $webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0"); echo "
"; print_r($webAuth); echo ""; $authorizeUrl = $webAuth->start(); echo "1. Go to: " . $authorizeUrl . "\n
"; echo "2. Click \"Allow\" (you might have to log in first).\n
"; echo "3. Copy the authorization code.\n
"; $authCode = \trim(\readline("Enter the authorization code here: ")); I have come through different forum where people said it will work in Command line , But I don't understand how? Any idea ? php readline dropbox-php share|improve this question edited Jul 13 '15 at 10:25 bcmcfc 9,0021564132 asked Apr 23 '14 at 8:04 M Fayyaz 3116 add a comment| 3 Answers 3 active oldest votes up vote 11 down vote Or just use this to simulate it function readline($prompt = null){ if($prompt){ echo $prompt; } $fp = fopen("php://stdin","r"); $line = rtrim(fgets($fp, 1024)); return $line; } share|improve this answer answered Aug 16 '14 at 13:48 Chris Gibb 35134 this is the oddest of things but thanks for the work-around –relipse May 25 at 20:50 For best support you should wrap in if(!function_exists("readline")) prevents the annoying redefine error –Martin Barker Sep 22 at 12:02 add a comment| up vote
Sign in Pricing Blog Support Search GitHub This repository Watch 6 Star 62 Fork 14 ieure/php_repl Code Issues 3 Pull requests 2 Projects 0 Pulse Graphs New issue enable readline? #3 Closed ivanoats opened this Issue Apr 16, 2011 · 2 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants ivanoats commented Apr 16, http://stackoverflow.com/questions/23238378/call-to-undefined-function-readline 2011 I must be missing something. How do you enable readline? I have tried the following in .phpreplrc readline = "true" readline = "yes" readline = "1" but they are all throwing exceptions ` php-repl PHP Fatal error: Call to undefined function readline() in /usr/local/Cellar/php/5.3.3/lib/php/PHP/Repl.php on line 171 PHP Stack https://github.com/ieure/php_repl/issues/3 trace: PHP 1. {main}() /usr/local/Cellar/php/5.3.3/bin/php-repl:0 PHP 2. PHP_Repl->run() /usr/local/Cellar/php/5.3.3/bin/php-repl:21 PHP 3. PHP_Repl->read() /usr/local/Cellar/php/5.3.3/lib/php/PHP/Repl.php:132 ` I do have readline installed (via homebrew on mac os x) Owner ieure commented Apr 16, 2011 While you have libreadline installed, your PHP was not compiled with the readline extension. You need to recompile it; see http://www.php.net/manual/en/readline.installation.php ieure closed this Apr 16, 2011 ivanoats commented Apr 17, 2011 ok, thanks for the tip. I recompiled php with readline and it works with readline ="1" in .phpreplrc Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
UTC http://www.resolvinghere.com/au/182989.shtml From: ramtsoft at gmail dot com Assigned: Status: Not a bug Package: Documentation problem PHP Version: 5.3.0 OS: windows xp sp3 Private report: fatal error No CVE-ID: View Add Comment Developer Edit [2009-11-13 19:02 UTC] ramtsoft at gmail dot com Description: ------------ Fatal error: Call to undefined function readline() in ... on line 4 fatal error call Reproduce code: --------------- --- From manual page: function.readline#Examples --- Expected result: ---------------- Work!!! Actual result: -------------- Error Patches Add a PatchPull Requests Add a Pull RequestHistoryAllCommentsChangesGit/SVN commitsRelated reports [2009-11-13 19:34 UTC] vrana@php.net Readline must be properly installed as stated at http://www.php.net/manual/en/readline.installation.php. Copyright © 2001-2016 The PHP Group All rights reserved. Last updated: Sat Oct 15 14:01:40 2016 UTC