Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

EkoSyahputra's avatar

PHP version on composer.json

I have an existing laravel project and yesterday just try upgrade from 5.8 to 6.0,

I got an issue regarding symphony translation, kindly refer to this https://github.com/symfony/symfony/issues/34482

When I try run "php --version" in visual code terminal it show "PHP 7.2.22" version, and when I check my composer.json file I see

"require": { "php": "^7.1.3",

So I quite confused right now, If my local currently run "PHP 7.2.22" then why I still got that symphony translation error? or my current project run php 7.1.3 (if yes how check it)?

Note:

  • When I run phpinfo on controller it show php 7.1.30

I am still beginner and sorry for my bad english

0 likes
3 replies
EkoSyahputra's avatar

I think I already found my issues, I think its related to brew services and valet (I am not understanding those due my college install it for me at first time), I am currently looking on it, Will post it here if already found the solution,.

EkoSyahputra's avatar
EkoSyahputra
OP
Best Answer
Level 1

Ok I already fix on my local, Refer to this for the fix https://github.com/laravel/valet/issues/237 What I do is:

  • run "brew services list" on my terminal
  • I notice got php version 7.1 and 7.2 running so I stop the php 7.1
  • Then when I run valet start, its rerun php 7.1 (so this is not the fix)
  • I run valet use [email protected] then all worked

Note:

  • for composer.json php still ^7.1.3 (no changes).

Please or to participate in this conversation.