0

I am using Brew to install latest php version, and it works in my terminal:

$ php -v
PHP 7.3.7 (cli) (built: Jul  5 2019 12:44:05) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.7, Copyright (c) 1999-2018, by Zend Technologies

But when I create a new symfony framework project, and run symfony server:start, it shows me that symfony using the old php7.1, but the installed latest php is 7.3.

$symfony server:start

 [WARNING] run "symfony server:ca:install" first if you want to run the web server
 with TLS support, or use "--no-tls" to avoid this warning


Jul 31 19:21:51 |DEBUG| PHP    Using PHP version 7.1.23 (from default version in $PATH)

the message shows it using php 7.1.23 from $PATH as default version, so I delete the php7.1.23 from the $PATH, and link php7.3 to the $PATH, but still not work

3
  • this might help: stackoverflow.com/questions/32482664/… Commented Jul 31, 2019 at 11:38
  • 1
    HINT: from default version in $PATH Commented Jul 31, 2019 at 11:42
  • 1
    @RiggsFolly how symfony find the default version? the php7.3 is in my $PATH too, and it works fine in the normal terminal environment. why symfony skip the php7.3 and choice the 7.1 Commented Jul 31, 2019 at 12:04

2 Answers 2

2

You can run symfony local:php:list to see a list of all php versions installed. To use a specific version, you can create a .php-version file that contains the version number.

Sign up to request clarification or add additional context in comments.

Comments

2

It is quite some time after but a fix the same problem in Windows 10 was to change the .php-version codification file to UTF8 (e.g. with notepad++).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.