Skip to content

Commit 47996ea

Browse files
committed
change cli version when changing fpm version
1 parent 6a07563 commit 47996ea

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cli/Valet/PhpFpm.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,20 @@ public function changeVersion($version = null)
112112
info('Changing version failed');
113113
throw $exception;
114114
}
115+
116+
$this->updateCliVersion();
117+
}
118+
119+
/**
120+
* Update the PHP CLI version.
121+
*
122+
* @return void
123+
*/
124+
protected function updateCliVersion()
125+
{
126+
$path = $this->cli->run("which php{$this->version}");
127+
128+
$this->cli->run("update-alternatives --set php $path");
115129
}
116130

117131
/**

0 commit comments

Comments
 (0)