安装后找不到php -v返回命令

我下载了最新的稳定的PHP 7版本。 然后安装所有依赖关系:

./buildconf ./configure \ --prefix=$HOME/php7/usr \ --with-config-file-path=$HOME/php7/usr/etc \ --enable-mbstring \ --enable-zip \ --enable-bcmath \ --enable-pcntl \ --enable-ftp \ --enable-exif \ --enable-calendar \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --with-curl \ --with-mcrypt \ --with-iconv \ --with-gmp \ --with-pspell \ --with-gd \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-zlib-dir=/usr \ --with-xpm-dir=/usr \ --with-freetype-dir=/usr \ --with-t1lib=/usr \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --with-openssl \ --with-mysql=/usr \ --with-pdo-mysql=/usr \ --with-gettext=/usr \ --with-zlib=/usr \ --with-bz2=/usr \ --with-recode=/usr \ --with-mysqli=/usr/bin/mysql_config 

之后我跑sudo makesudo make test然后sudo make install 。 一切顺利。 我想我在执行php -v时缺less了几个步骤。 它说command not found所以,我去了安装文件夹/opt/php-7.0.0/bin,并试图./php -v这将返回:

 PHP 7.0.0 (cli) (built: Dec 11 2015 16:38:27) ( NTS ) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies 

我还需要做什么? 任何帮助是极大的赞赏。

您需要将/opt/php-7.0.0/bin添加到您的path。

$export PATH=/opt/php-7.0.0/bin:$PATH
这将改变当前的shell。

要使这些更改永久化,请将上面的命令添加到〜/ .bash_profile文件的末尾。