Installing, Configuring PHP and Running PHP scripts

In order to run PHP on your Windows system, you can simply have the required version of regular or debug PHP zip files and extract them.  And then ensure that extracted location is in %PATH% so that Windows starts picking up that particular version of php by defult for running .php scripts/files locally.

Example: On the same system you can run multiple versions of PHP side-by-side.

C:>php -v
PHP 5.3.24 (cli) (built: Apr 10 2013 18:32:42)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

C:>php-5.5.6php.exe -v
PHP 5.5.6 (cli) (built: Nov 12 2013 11:35:48)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies

C:>

 

Executing PHP scripts:

Create a quick Hello world PHP script as shown below:

C:>type TempTest-PHP.php

<?php

        echo "Hello World!! from PHP Scripts"

?>
C:>

 

Run the Hello world script as shown below:

C:>php TempTest-PHP.php

Hello World!! from PHP Scripts
C:>

Leave a Reply

Your email address will not be published. Required fields are marked *