How to find the installation path of php in linux

王林
Release: 2023-06-03 14:27:17
forward
2316 people have browsed it

1. Use the which command to find PHP

Use the which command to quickly find the PHP path you installed. The specific command is as follows:

which php
Copy after login

After entering the command, the installation path of the PHP program in the current system will be output, as shown below:

/usr/bin/php
Copy after login

2. Use the whereis command to find PHP

Use the whereis command in the same way You can find the installation path of the PHP program. The specific command is as follows:

whereis php
Copy after login

After entering the command, the installation path of the PHP program in the current system will be output, as shown below:

php: /usr/bin/php /usr/share/php /usr/share/man/man1/php.1.gz
Copy after login

Among them, the first path It is the system default PHP installation path, the second path is the source code path of the PHP program, and the third path is the help document path of the PHP program.

3. Use the find command to find PHP

Use the find command to find all files containing php on the system to find the installation path of the PHP program. The specific command is as follows:

find / -name php
Copy after login

This command will search for files containing php in the root directory. Since it needs to be searched in full, it will be slow, but it can also find all PHP program installation paths.

The above is the detailed content of How to find the installation path of php in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!