2

I want to set PHP environment variable.

I tried this solution from How to set the env variable for PHP?

You need to put the directory that has php.exe in you WAMP installation into your PATH. It is usually something like C:\wamp\xampp\php

I put PATH=C:\xampp\php in path. Now what to do next?

When I execute php array.php it says Could not open input file:array.php.

Community
  • 1
  • 1
Aanshi
  • 282
  • 1
  • 5
  • 22
  • 1
    Do not pay attention to the accepted answer. Look for the one with the most points. The answer with 8 points is the one you need to look at. – castis Nov 14 '13 at 05:41

1 Answers1

3

In command prompt

SET PATH=%PATH%;C:\xampp\php

OR

in windows 7

right click on my computer -> properties ->Advanced System Settings(On left side bar) -> select Advanced tab ->Environment Variables -> From System variable select Path and edit(Don't press new) -> put a ; at the end and then php.exe path paste it there.

and you've done

  • i did it.Now when try to to execute php array.php then its says could not open input file – Aanshi Nov 14 '13 at 06:05
  • e.g there is only one line echo "hello" but still its says could not open input file when i execute php hello.php from cmd – Aanshi Nov 14 '13 at 06:14
  • Where you're placing the `.php` file and what is your url for the access ? –  Nov 14 '13 at 06:15
  • can you show me the exact error you're getting from the browser ? –  Nov 14 '13 at 06:23
  • If i run this in browser then its works fine but when i execute it in cmd then it says "Could not open input file". – Aanshi Nov 14 '13 at 06:46
  • You may not have permission to r/w/x on that file –  Nov 14 '13 at 12:35