Is there any compiled php package with readline support built-in?
readline is required in order to use php in interactive mode.
I looked at how to compile php for windows but they require MS Visual Studio which I don't have.
Readline extension is not available on Windows. I think it is possible to compile PHP under cygwin enabling --with-readline
option
//The readline library is not available on Windows.
<?php
if (PHP_OS == 'WINNT') {
echo '$ ';
$line = stream_get_line(STDIN, 1024, PHP_EOL);
} else {
$line = readline('$ ');
}
?>
I found this code straight out of the php documentation. As you may see there is no support for the readline library in windows machines (at least in a ddefault packet) which sucks but you can get something similar by doing the "$line = blah, blah " you see in the code above.
I tried it and made it work using window's standard cmd (althought I think the interactive php mode won't work in windows no matter what) but It's better than not having any user input (if you actually get to remember all that code).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With