Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel valet using wrong version of PHP

I'm running valet 2.0.5 and it is using the wrong version of PHP. When starting valet I get

$ valet start
Restarting php71...
Restarting nginx...
Valet services have been started.

But phpinfo() gives PHP Version 5.6.30 and Loaded Configuration File: /usr/local/etc/php/5.6/php.ini.

I've installed and relinked php using brew,

$ which php
/usr/local/opt/php71/bin/php

$ php -v
PHP 7.1.7

I've tried uninstalling and reinstalling valet, to no avail.

like image 877
jsindos Avatar asked Nov 02 '25 04:11

jsindos


1 Answers

The old version of PHP (in my case 7.4) was "stuck" for some reason in Valet. Even though php -v returns me php 8.0. The way to force Valet to choose the right version you can use the following command:

valet use [email protected] --force
like image 158
Mac Avatar answered Nov 04 '25 18:11

Mac



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!