BigBug
BigBug

Reputation: 6290

problems running a PHP script from command line

I'm not sure what i'm doing wrong here. I've set up the environment variables... and i can do php -v and it'll show me the version. However, if i do php blah.php to run a php script i've written, the console returns with no errors and the script is not run? I know this script works, because i made it a long time ago when i first worked with PHP - however, i don't remember PHP or anything about it at the moment.

does it have something to do with SET PATH? I don't see a .bat file in the PHP folder though. Yet, it seems to be working fine when i run php -v... so confused...

Help? How do i run this script?

Upvotes: 0

Views: 207

Answers (2)

TecBrat
TecBrat

Reputation: 3729

try

php -f blah.php

From php -h

-f Parse and execute <file>.

Upvotes: 1

jmkelm08
jmkelm08

Reputation: 687

You should use the -f option to execute a file

php -f blah.php

It may also be useful to read the help

php -h

Upvotes: 2

Related Questions