Sunny300
Sunny300

Reputation: 29

How to run php file

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

Answers (1)

RedactedProfile
RedactedProfile

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

Related Questions