Home > Backend Development > PHP Problem > How to find the installation path of php in linux

How to find the installation path of php in linux

PHPz
Release: 2023-03-23 17:22:01
Original
2030 people have browsed it

In the process of using the Linux operating system, sometimes it is necessary to find the installation path of the installed PHP program in order to perform related operations. So how to find the installation path of PHP in the Linux system? Here are some specific ways.

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

Enter After the command, the PHP program installation path 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 to also find PHP The installation path of the 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 is the system default The 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.

Summary

Whether you use the which command, whereis command or find command, you can quickly find the PHP program installation path on the Linux system. In practical applications, appropriate search methods can be selected according to different needs to improve efficiency.

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:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template