-2

I have instruction, but the problem is when I install xampp and enter ( php - v )in the cmd shows me :Could not open input file: - I have already read about the adding environment variables and done this but unfortunately it still can't find it. What can i do ?

  • I wouldn't do this alone to check php version .. Create a file `phpinfo.php` and add the following: `` – Zak Jan 30 '18 at 20:02
  • 2
    Should be closed as typo. – trincot Jan 30 '18 at 20:03
  • @trincot Yes, and I'm voting that way, but I'm also going to answer it as it strikes me that plenty of other people will make this typo if they're not used to unix commands... – Matt Gibson Jan 30 '18 at 20:07

2 Answers2

1

It's php -v. Note the lack of a space between the - and the 'v'. What the error message is telling you is literally "Could not open input file: -", that is, the PHP interpreter is running fine, but it's trying to open a file called '-' because of the extra space you put in.

Matt Gibson
  • 36,429
  • 9
  • 89
  • 124
1

The commando don't have a space between the - and the v.

php -v

But this will not necessarily mean the version of php used by XAMPP is this one. XAMPP can be using another version under the hood.

A better way is creating a .php file and accessing using XAMPP - probably in http://localhost - with the code:

<?php
phpinfo()
?> 
Marcos
  • 702
  • 9
  • 19