Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPInfo / Valet - Two different PHP versions

Tags:

php

laravel

valet

OK so I am experiencing something quite odd. My phpinfo() shows one version while php -v shows another.

I am running locally on a MacBook Air (Mojave), with Laravel and Valet.

phpinfo():

PHP Version 7.2.13

Configuration File (php.ini) Path   /usr/local/etc/php/7.2
Loaded Configuration File   /usr/local/etc/php/7.2/php.ini
Scan this dir for additional .ini files /usr/local/etc/php/7.2/conf.d

While in my terminal, it shows:

php -v

PHP 7.3.0 (cli) (built: Dec  7 2018 11:00:11) ( NTS )

Now, if I do a which php I get this:

/usr/local/bin/php

In my ~/.bash-profile, I have this:

export "PATH=~/.composer/vendor/bin:$PATH"

I have tried to:

  • Restart Nginx
  • Restart Valet

  • Unlink PHP@7.2 and link PHP@7.3with Homebrew:

    Olivers-MacBook-Air:~ oliverbusk$ brew unlink php@7.2 Error: No such keg: /usr/local/Cellar/php@7.2

How can I get my actual valet site to use php@7.3?

like image 434
oliverbj Avatar asked Dec 10 '18 20:12

oliverbj


1 Answers

Below simple fix worked for me.

rm ~/.config/valet/valet.sock
valet restart 
like image 88
Chk Avatar answered Sep 22 '22 18:09

Chk