Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GodziLaravel's avatar

SSH php version not the same as Vagrant

Hello,

when I run php version from the SSH vagrant :

php -v
PHP 7.1.28-1+ubuntu18.04.1+deb.sury.org+3 (cli) (built: Apr 10 2019 10:50:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.28-1+ubuntu18.04.1+deb.sury.org+3, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.24.4~linux-x64-non_zts71, https://blackfire.io, by Blackfire

but If I exit from the SSH :

php -v
PHP 7.3.2 (cli) (built: Feb  5 2019 23:16:38) ( ZTS MSVC15 (Visual C++ 2017) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies

What Im looking for is to downgrade php version to 7.1 (laravel 5.2)

NOTE :

on phpinfo() ; PHP verison is 7.3 !

thanks

0 likes
1 reply
Nash's avatar

Vagrant/Homestead is a virtual Ubuntu machine with its own PHP installation. The other one is probably the version you have installed on your own machine. You can change the PHP version in Homestead by running php71 (for 7.1) or some other version. You can also change the version per-project in you Homestead.yaml file.

https://laravel.com/docs/5.8/homestead#multiple-php-versions

Please or to participate in this conversation.