Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use PHP for some OS scripting, is there any proper file extension other than .php for PHP cli programs? So I can assign php.exe to run these kind of files directly. Is .phps a good candidate?

I want just CLI programs be opened (by double clicking) by PHP.exe not other php files, so a differnt file extension should be used

share|improve this question
php.exe? Windows? Please tag your question. – Dennis Williamson Jul 14 '12 at 0:12
phps indicates to the web server to not execute it, but rather have the contents displayed with syntax highlighting -- the "s" stands for "source". – Izzy Jul 14 '12 at 19:32
@lzzy Thanks, What is your suggestion? – PHPst Jul 15 '12 at 2:35
.php is the most commonly used extension. – Michael Hampton Jul 15 '12 at 2:57
up vote 5 down vote accepted

You can create and assign any extension you wish. Simply create a file, give it the extension you desire (that is not already in use), and then right-click it and select Open With. Now select the PHP executable from the Open With dialog (Browse for it if necessary) and select the Always use… checkbox.

For the record, .phps PHP source-code files that are meant to be rendered as source with syntax-highlighting instead of executed, so you may want to use something else like .phpcli

enter image description here

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .