为什么Oracle Linux无法识别php包?
问题描述:
I checked here that using php -v
or php -i
should show my php version. Although, when I type these commands, I got -bash: php: command not found
. When I type rpm -qa | grep php
I get
php71w-bcmath-7.1.11-1.w7.x86_64
php71w-pdo-7.1.11-1.w7.x86_64
php71w-ldap-7.1.11-1.w7.x86_64
mod_php71w-7.1.11-1.w7.x86_64
php71w-mbstring-7.1.11-1.w7.x86_64
php71w-xml-7.1.11-1.w7.x86_64
php71w-mysql-7.1.11-1.w7.x86_64
php71w-gd-7.1.11-1.w7.x86_64
php71w-common-7.1.11-1.w7.x86_64
And when I type yum provides php | grep php71w
(showing all packages that has php
command and has php71w
on its name) I get
mod_php71w-7.1.8-2.w7.x86_64 : PHP module for the Apache HTTP Server
mod_php71w-7.1.9-1.w7.x86_64 : PHP module for the Apache HTTP Server
mod_php71w-7.1.9-2.w7.x86_64 : PHP module for the Apache HTTP Server
mod_php71w-7.1.10-1.w7.x86_64 : PHP module for the Apache HTTP Server
mod_php71w-7.1.11-1.w7.x86_64 : PHP module for the Apache HTTP Server
mod_php71w-7.1.11-1.w7.x86_64 : PHP module for the Apache HTTP Server
What I'm missing? If mod_php71w-7.1.11-1.w7.x86_64 : PHP module for the Apache HTTP Server
has php command and it's listed as installed, why php -v
is not recognized?
答
The PHP Command Line Interface is typically not installed by default. Just find the correct php-cli package for your distro/version and install it.