Can there be any trick to operate .PHP files in home windows XP from the folder by double clicking like HTML file ?
I personally use XAMPP however in this we have to put files ina special htdocs folder. I wish to run file from the folder, desktop by double clicking.
After searching a great deal I discovered a good way to do that
PHPScriptNet – Great portable application for individuals who learning PHP. PHPScriptNet can run your PHP script any place in Home windows machine without setting up PHP or any webserver.
There's a substantial difference in viewing HTML files versus. PHP files:
HTML files are static files construed through the browser. Whenever you open them, the road to the HTML file is passes being an argument towards the default browser which translates and shows the file.
PHP files however are needed to become construed with a PHP interpreter (XAMPP, inside your situation) prior to the resulting HTML is made with a browser. Within this situation, the neighborhood file PATH would need to be converted towards the corresponding local URL, then delivered to the browser.
You can write an easy script that replaces '/var/www/' with 'http://localhost:8888/' (having a regular expression, for instance) and passes that towards the browser. Then, connect PHP files together with your script.
PHP has a command line interface interpreter known as php.exe (in Home windows). This are available in the main of the PHP installation directory.
You will have to connect .php files with this particular interpreter. That's, get into Tools -> Folder Options -> File types, and register
php.exe -f "%1" because the application for that .php file type.
Nevertheless, it's not so typical to wish to 'run' a PHP file by double-clicking it - very few people would use PHP exactly the same way they'd use, for instance, batch files or spend scripts - PHP is way better suitable for producing webpages, ie utilizing it inside a web server. Odds are, running PHP outdoors of the web server isn't what you want to complete here. For instance, the PHP file will run inside a command window and it is output is going to be plain text, and when you need to see its output your script will have to pause or watch for input from standard input itself after terminating.
More details at Using PHP from the command line