PHP -v命令根据我当前的目录提供不同的结果

时间:2018-04-21 23:23:21

标签: linux bash centos

操作系统:php -v, PHP版本:`5.6'

当我在主目录中运行ea-php-cli Copyright 2017 cPanel, Inc. PHP 5.6.35 (cli) (built: Apr 5 2018 20:30:39) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.0, Copyright (c) 2002-2018, by ionCube Ltd. with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies 时,我得到以下结果

php -v

当我在public_html目录中运行ea-php-cli Copyright 2017 cPanel, Inc. PHP 7.0.29 (cli) (built: Apr 5 2018 20:30:36) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.29, Copyright (c) 1999-2017, by Zend Technologies 时,我得到了以下结果:

public_html

有一些明显的差异,但我主要担心的是显示PHP版本的行。为什么我的PHP 7.0.29目录显示$query = Books::find(); $query->select([ 'book_id,picture', 'book_name', 'author_name', new Expression('MATCH (author_name) AGAINST (:author_name) + MATCH (book_name) AGAINST (:book_name) AS total', [ 'author_name' => $this->author_name, 'book_name' => $this->book_name, ]), ]); if (!empty($this->author_name)) { $query->andWhere(new Expression('MATCH (author_name) AGAINST (:author_name)', [ 'author_name' => $this->author_name, ])); } if (!empty($this->book_name)) { $query->andWhere(new Expression('MATCH (book_name) AGAINST (:book_name)', [ 'book_name' => $this->book_name, ])); } $query->orderBy('total DESC') ->limit(25); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); ???我真的需要它和其他目录一样。

我之前从未见过这样的问题,导致目录有不同PHP版本的问题是什么?

1 个答案:

答案 0 :(得分:0)

经过更多研究后,我注意到此用户已设置为在我的 WHM 上使用PHP 7.0multiPHP Manager。奇怪,但那是造成这个问题的原因。