如何找到php的可执行路径?

Gen*_*ant 7 php

我需要有我的php的可执行路径,因为我想在eclipse php上运行php文件。显然没有exe文件,那么我必须搜索到哪个文件呢?

Jos*_*Jos 14

默认的可执行文件可以通过以下方式找到:

which php
Run Code Online (Sandbox Code Playgroud)

在我的系统上,这会导致/etc/bin/php. 但是,如果我列出该文件,则会发现它是指向以下内容的符号链接/etc/alternatives/php

$ ls -l /usr/bin/php
lrwxrwxrwx 1 root root 21 mei 10  2016 /usr/bin/php -> /etc/alternatives/php
Run Code Online (Sandbox Code Playgroud)

反过来,(在我的系统上)这是一个符号链接/etc/bin/php7.2

$ ls -l /etc/alternatives/php
lrwxrwxrwx 1 root root 15 jun 20  2018 /etc/alternatives/php -> /usr/bin/php7.2
Run Code Online (Sandbox Code Playgroud)

这是实际的可执行文件:

$ file /usr/bin/php7.2
/usr/bin/php7.2: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=1b669fd85cfcca25b9733cacf7e7ebaafc0ce17e, stripped
Run Code Online (Sandbox Code Playgroud)