Home > Article > Backend Development > Linux looks at the php installation path
In Linux systems, the PHP installation path can be viewed in a variety of ways. Several common methods will be introduced below.
The which command can be used to find the location of a command or program in the file system. Enter the following command in the terminal:
which php
If PHP is already installed and in the system path, output similar to the following will be displayed:
/usr/bin/php
whereis phpIf PHP has been installed and is in the system path, output similar to the following will be displayed:
php: /usr/bin/php /etc/php /usr/include/php /usr/share/php /usr/share/man/man1/php.1.gzwhere /usr/bin/php is the location of the PHP command ,/etc/php is the location of the PHP configuration file.
where phpIf PHP has been installed and is in the system path, output similar to the following will be displayed:
/usr/bin/php /usr/include/php /usr/share/phpwhere /usr/bin/php is the location of the PHP command .
locate phpIf PHP is installed and in the system path, all files and directories containing the "php" keyword will be displayed, including the installation location of PHP. Any of the above methods can be used to find the installation path of PHP. Generally speaking, PHP's command path is /usr/bin/php, and its configuration file path is /etc/php. You can use either of them to view the PHP installation path.
The above is the detailed content of Linux looks at the php installation path. For more information, please follow other related articles on the PHP Chinese website!