huh? you don't need an environment variable to run java either. I think you're getting things very mixed up.

environment variables are variables stored for the system. they aren't required for anything you're doing. variables provide shortcuts; they do not run programs.

if you wanted a shorthand way to run php files (without needing to provide the full path of PHP), you could append the environment variable "path" with the path to PHP's installed directory. this will let you run "php.exe" without needing to be in PHP's native directory.
Code:
set path=%path%;E:\root\php5
then, you could run this:
Code:
php E:\root\www\script.php
if you'd like to permanently add that path to the "path" variable, then you'll need to change the environment variables. in windows explorer, type in the path, "Control Panel\System and Maintenance\System", then click on "Change Settings." you'll need to confirm with UAC if you have it on. go to the "Advanced" tab, then to "Environment Variables" at the bottom. under "System Variables," there will be one named "Path." you can simply append ";E:\root\php5" to it, not forgetting to add the semi-colon. and don't get rid of any of the information inside of that variable already.