Skip to content

Commit 735c435

Browse files
authored
Merge pull request #332 from ahmed-aliraqi/master
Change CLI & FPM version when call 'valet use' command
2 parents 6a07563 + 47996ea commit 735c435

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)