I've been using PHP since PHP3, but somehow I've never really heard of the interactive mode flag before, and when I tried to use it... it doesn't work, sort of.
Anyway... I use: php -a
Then I type in some php code, ie: <?php print "Hi"; ?>
I have to press ctrl+d, enter, ctrl+d (Linux).. or ctrl+z, enter, ctrl+z (Windows)....... then it exits. I see sometimes people using something like:
php > here is where you'd enter code.
php > and here
php > and here..
Mine don't show any sort of "console" prompt I guess you could say. Any idea why not and how I can get it?
[SOLVED] PHP Interactive Mode
Moderator: General Moderators
[SOLVED] PHP Interactive Mode
Last edited by Mirge on Mon Sep 21, 2009 4:30 pm, edited 1 time in total.
Re: PHP Interactive Mode
From the manual,
So on Windows, `php` and `php -a` are basically the same. On Unix you have to install that one extension to get the fancy features.Runs PHP interactively. If you compile PHP with the Readline extension (which is not available on Windows), you'll have a nice shell, including a completion feature (e.g. you can start typing a variable name, hit the TAB key and PHP completes its name) and a typing history that can be accessed using the arrow keys. The history is saved in the ~/.php_history file.
Re: PHP Interactive Mode
Ahh thanks. I've been searching around for a while & never ran across that. I've lived without it for years, I'll be okay without it
.