Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

command line -r not working on windows

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

command line -r not working on windows

Postby raphael75 » Mon Feb 24, 2014 5:36 am

We have a server with windows 2008 R2 with PHP5 installed. I can run php files from the command line using

php -f file.php

with no problem. However, when I try to run PHP code inline nothing happens:

php -r 'echo "hello world";'

Literally no output.

Do I need to configure something in php.ini to get the -r to work?

Thanks!
raphael75
New php-forum User
New php-forum User
 
Posts: 20
Joined: Fri Apr 06, 2012 9:54 pm

Re: command line -r not working on windows

Postby raphael75 » Mon Feb 24, 2014 8:45 am

I got the answer on another forum. Turns out I had to swap the quotation marks:

php -r "echo 'Hello world';"
raphael75
New php-forum User
New php-forum User
 
Posts: 20
Joined: Fri Apr 06, 2012 9:54 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 5 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.