command line -r not working on windows

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

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';"


Return to “PHP coding => General”

Who is online

Users browsing this forum: krotbacca and 1 guest

cron