-2

My current version of PHP is 5, I download the version 7 and installed it, I am using IIS server.

Here is my ISS manager:

phpinfo()

It says that the version of PHP is 7.1.6, but when I run a PHP version check in the command line it gave me this:

Microsoft Windows [Version 18.8.15863] (c) 2817 microsoft Corporation. All rights reserved . 
C:\Users\marvenwi1sons>php --version 
PHP S. 3.5 (cli) (built: Jan S 2811 Copyright (c) 1997-2818 The PHP Group 
Zend Engine v2 .3 . 8, Copyright (c) 1998-2818 Zend Technologies 
C:\Users\marvenwi1sons> 

Here are the steps that I took:

  1. Download php7 as zip
  2. Make new folder named “php” to C > programfiles
  3. Extract the downloaded php7 zip file to “php” folder
  4. In IIS manager I clicked PHP Manager
  5. Then I Clicked “Register new PHP version”
  6. Then I navigate to “php” folder and clicked “php-cgi.exe”
  7. Then I check php info and restart the IIS then restart my computer
Nisse Engström
  • 4,738
  • 23
  • 27
  • 42

1 Answers1

2

When you run phpinfo and it is running fine ,then you have your php application working fine in IIS.

I guess What is not running for you is the php command from Windows Command line, it looks in the Path variables to find where the command executable is . To find where it picks up the command line,you can run the command where

e.g for node

C:\Users\Rohit>where node
C:\Program Files\nodejs\node.exe

So you can run where and find out where your php.exe is . This path would have added to your path

You can also run following command to print this in windows

C:\Users\Rohit>echo %Path%

You have to edit the path to point to where your php7 resides (installed in your machine).This SO and this article has instructions to do this

Rohith
  • 5,527
  • 3
  • 27
  • 31
  • It is very likely that the %path% variable still points to the old PHP installation. PHP Manager won't change that, and the user is expected to remove the old folder from %path% and add the new folder instead. – Lex Li Aug 02 '18 at 16:40