command line -r not working on windows

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

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: 32
Joined: Fri Apr 06, 2012 9:54 pm

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

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider] and 2 guests