Home » Php » How to update php 5.4 to 7.0 via CLI in Windows

How to update php 5.4 to 7.0 via CLI in Windows

Posted by: admin February 25, 2020 Leave a comment

Questions:

I use this command:

export PATH=/usr/local/php7/bin:$PATH

But still showing:

PHP 5.4.45 (cli) (built: Apr 17 2017 15:59:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd.
with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies

I need to fix that, help me.

How to&Answers:

Are you doing this through a profile file?

  1. you can create a .profile file if it does not exist: touch ~/.profile
  2. edit the .profile file: nano ~/.profile
  3. add this code inside the file to choose the desired php version: export PATH=/opt/php7.0/bin:$PATH
  4. load the .profile file: source ~/.profile
  5. check the version again: php -v