Home > Operation and Maintenance > CentOS > How to check the php installation directory in centos7

How to check the php installation directory in centos7

WBOY
Release: 2022-02-22 10:36:18
Original
4930 people have browsed it

How to view the PHP installation directory in centos7: 1. Use the whereis command to view. This command is used to find files. The syntax is "whereis php"; 2. Use the find command to view it. This command is used to view in the specified directory. To search for files, the syntax is "find / -name php*".

How to check the php installation directory in centos7

The operating environment of this article: centos 7 system, PHP version 7.1, Dell G3 computer.

How to check the PHP installation directory in centos7

The server has PHP installed, but I don’t know which directory it is installed in. You can query it in the following way.

1. Use the command whereis php,

hereis command is used to find files.

This command will search for files that meet the conditions in a specific directory. These files should be raw code, binary files, or help files.

This command can only be used to find binary files, source code files and man pages. Generally, you need to use the locate command to locate files.

Syntax

whereis [-bfmsu][-B <目录>...][-M <目录>...][-S <目录>...][文件...]
Copy after login

Parameters

  • -b Only search binary files.

  • -B Only searches for binary files in the set directory.

  • -f does not display the path name before the file name.

  • -m Only search for documentation.

  • -M Only search for description files in the set directory.

  • -s Only search original code files.

  • -S Only search the original code files in the set directory.

  • -u Find files that do not contain the specified type.

The example is as follows:

php: /usr/bin/php /etc/php.ini /etc/php.d /usr/include/php /usr/share/php /usr/share/man/man1/php.1.gz
Copy after login

Where:

/usr/bin/php is the path to the executable file;

/ etc/php.ini is the path to the PHP configuration file;

/etc/php.d is the path to other PHP-related configuration files;

/usr/include/php is the path to the PHP extension file;

/usr/share/php is the path to the shared file;

/usr/share/man/man1/php.1.gz is PHP related information.

2. Use the find command to find the PHP installation directory

The find command is used to find files in the specified directory. Any string preceding the parameter will be treated as the name of the directory to be searched. If you use this command without setting any parameters, the find command will search for subdirectories and files in the current directory. And all found subdirectories and files will be displayed.

Grammar

find   path   -option   [   -print ]   [ -exec   -ok   command ]   {} \;
Copy after login

Examples are as follows:

find / -name php*
Copy after login

Recommended learning: "PHP Video Tutorial"

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

Related labels:
source:php.cn
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