Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.