phpinfo() is showing a wrong information running on Valet

Published 2 months ago by m7vm7v

In a Laravel application I am returning phpinfo() in my route and it shows me 'PHP Version 7.0.20'

But when I run php --version in the terminal I have 'PHP 7.1.7 (cli)'.

I did 'brew unlink php70', 'brew link php71', 'brew services start php71'.

I have uninstalled php70 and all the dependencies with brew and did run valet restart.

I am running on mac machine with Laravel 5.2 with Valet and php 7.1.

Do you know how to link my php7.1 instead 7.0? Would that be a problem related with Valet or brew or php itself?

Thanks for your time

Best Answer (As Selected By m7vm7v)
danmatthews

I've had this multiple times, if you run valet stop, then valet start, it should pick up the right version.

You should see something like this in the terminal when you run valet stop:

Stopping php70...
Stopping php71...
Stopping nginx....
Valet services have been stopped.

Then when you start, you should notice it starts up the right version:

Restarting php71...
Restarting nginx...
Valet services have been started.
danmatthews

I've had this multiple times, if you run valet stop, then valet start, it should pick up the right version.

You should see something like this in the terminal when you run valet stop:

Stopping php70...
Stopping php71...
Stopping nginx....
Valet services have been stopped.

Then when you start, you should notice it starts up the right version:

Restarting php71...
Restarting nginx...
Valet services have been started.
saurabhd

check your apache httpd.conf file located at /etc/apache2/httpd.conf. If still problem not resolved you need to check and update PATH like:

export PATH=/usr/local/php5/bin:$PATH
m7vm7v

Thank you both for the answers.

I believe that @danmatthews is having the right answer.

What I did to fix it was 'valet install' and it started working fine after.

Thanks for the help again

Please sign in or create an account to participate in this conversation.