Home  >  Article  >  Operation and Maintenance  >  How to find the installation path of php in linux

How to find the installation path of php in linux

王林
王林forward
2023-06-03 14:27:172455browse

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

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

/usr/bin/php

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

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

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

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete