Symfony框架无法使用自制软件安装的php [英] Symfony framework cannot use homebrew installed php

查看:90
本文介绍了Symfony框架无法使用自制软件安装的php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Brew安装最新的php版本,并且可以在我的终端上使用:

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

但是当我创建一个新的symfony框架项目并运行symfony server:start时,它向我显示了使用旧php7.1的symfony,但已安装的最新php是7.3.

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)

该消息显示使用$ PATH的php 7.1.23作为默认版本,因此我从$ PATH删除了php7.1.23,并将php7.3链接到$ 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

推荐答案

您可以运行symfony local:php:list来查看所有已安装的php版本的列表.要使用特定版本,您可以创建一个包含版本号的.php-version文件.

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.

这篇关于Symfony框架无法使用自制软件安装的php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆