问题原因:主要是php执行文件不在/usr/local/bin里
我的php执行文件目录在 /usr/local/php/bin 里面
/usr/local/php/bin: 路径下的php是执行文件
解决方案:
1.找到php的可执行文件
2.切换到/usr/local/bin目录下
3.建立软连接
[root@root bin]# ln -s /usr/local/php/bin/php /usr/local/bin/php
[root@root bin]# ln -s /usr/local/php/bin/php /usr/local/bin/php
[root@root bin]# l
total 34M
lrwxrwxrwx 1 root root 22 Jun 3 22:29 php -> /usr/local/php/bin/php*
-rw-r--r-- 1 root root 92 May 22 01:06 dump.rdb
lrwxrwxrwx 1 root root 12 Apr 22 09:53 redis-sentinel -> redis-server*
-rwxr-xr-x 1 root root 7.8M Apr 22 09:53 redis-check-aof*
-rwxr-xr-x 1 root root 7.8M Apr 22 09:53 redis-check-rdb*
-rwxr-xr-x 1 root root 4.6M Apr 22 09:53 redis-cli*
-rwxr-xr-x 1 root root 4.2M Apr 22 09:53 redis-benchmark*
-rwxr-xr-x 1 root root 7.8M Apr 22 09:53 redis-server*
drwxr-xr-x 3 root root 4.0K Mar 8 16:16 vendor/
-rwxr-xr-x 1 root root 102K Jan 17 11:19 iconv*
-rwxr-xr-x 1 root root 175K Jan 17 11:11 jeprof*
-rwxr-xr-x 1 root root 145 Jan 17 11:11 jemalloc.sh*
-rwxr-xr-x 1 root root 1.8K Jan 17 11:11 jemalloc-config*
-rwxr-xr-x 1 root root 756K Jan 17 11:10 htop*
[root@root bin]# composer -v
PHP Warning: Module 'fileinfo' already loaded in Unknown on line 0
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.9.3 2020-02-04 12:58:49
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
--no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
使用composer -v 测试 出现以上成功