trusktr
trusktr

Reputation: 45504

I just want to run PHP in the command line in Windows. How to get started?

In Linux, all I had to do was install PHP and boom, I'm ready to go and can execute PHP scripts via command line.

In Windows, is it the same? If I just download the binary and install it, then can I run command line PHP? And also, should I get the thread-safe or non-thread-safe version? I have neither IIS (or do I with Windows 7 Ultimate?) nor Apache. I just want command-line functionality!

Thanks for the advice!

Upvotes: 6

Views: 15678

Answers (1)

user180100
user180100

Reputation:

It's the same under Windows, you just need to make sure php.exe is in your PATH (in order to use php.exe from any directory) and you need to use CTRL-Z+RETURN for EOF (CTRL-D under Unix):

sample session:

D:\dev\php>php
<?php
echo 'foo';
?>
^Z
foo
D:\dev\php>

Upvotes: 9

Related Questions