Reputation: 29
I have added this to path:C:\xampp\php. separate by semi colon, & when I put this address (localhost/myfiles/hello.php) on the browser the file was opened properly, so, why cant it be opened in cmd?& I always get this message:Windows cant open this file.
Upvotes: 2
Views: 196
Reputation: 2808
command is looking for an absolute path to the file, not an address
$ php ../path/to/myfiles/hello.php
edit
Upon re-reating your question, I could also assume your forgetting to add the php
command to the command. Adding the path to PHP in XAMPP allows you to execute the php executable through the command line interface. So you run php
and then the switch configs and then the filepath.
Upvotes: 4