Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- php -r
- Daniel Klein
January 6, 2008, 2:27 pm
rate this thread
I had thought that this would work...
C:\>php -r echo "test";
PHP Parse error: syntax error, unexpected $end in Command line code
on line 1
But as you can see, it doesn't. I've tried Google'ing the answer to no
I'm using Windows/Apache/MySQL and:
PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
- The Natural Philosopher
January 6, 2008, 2:31 pm
Re: php -r
Daniel Klein wrote:
You need to escape certain characters from the shell. For most Linux
shells you could use:
php -r echo\ \"test\"\;
or (slightly easier on the eye):
php -r 'echo "test";'
Not sure what it would be on Windows, but give those two a whirl.
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 18.104.22.168-mm-desktop-9mdvsmp, up 7 days, 2:22.]