note 53373 deleted from features.commandline by cmb
| From: | cmb@php.net | Date: | Sun, 30 Jun 2019 09:51:28 +0000 |
| Subject: | note 53373 deleted from features.commandline by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211432@lists.php.net to get a copy of this message | ||
Note Submitter: linus at flowingcreativity dot net
----
If you are using Windows XP (I think this works on 2000, too) and you want to be able to right-click
a .php file and run it from the command line, follow these steps:
1. Run regedit.exe and *back up the registry.*
2. Open HKEY_CLASSES_ROOT and find the ".php" key.
IF IT EXISTS:
------------------
3. Look at the "(Default)" value inside it and find the key in HKEY_CLASSES_ROOT with that
name.
4. Open the "shell" key inside that key. Skip to 8.
IF IT DOESN'T:
------------------
5. Add a ".php" key and set the "(Default)" value inside it to something like
"phpscriptfile".
6. Create another key in HKEY_CLASSES_ROOT called "phpscriptfile" or whatever you chose.
7. Create a key inside that one called "shell".
8. Create a key inside that one called "run".
9. Set the "(Default)" value inside "run" to whatever you want the menu option
to be (e.g. "Run").
10. Create a key inside "run" called "command".
11. Set the "(Default)" value inside "command" to:
cmd.exe /k C:\php\php.exe "%1"
Make sure the path to PHP is appropriate for your installation. Why not just run it with php.exe
directly? Because you (presumably) want the console window to remain open after the script ends.
You don't need to set up a webserver for this to work. I downloaded PHP just so I could run
scripts on my computer. Hope this is useful!