0

I ran the following commands twice to ensure it's installed:

yum install php72 php72-cli returns

Package php72-1.0-1.el7.remi.x86_64 already installed and latest version

now running php -v returns

-bash: php: command not found

Note: This is on Vagrant running centos/7 box.

Any ideas?

  • 2
    It depends from what repository those packages originate. For example, if you install something from SCL those packages typically go into /opt and therefore binaries do not (automatically) appear on PATH. Simply run yum whatprovides */php or (more ugly but still my favorite) find / -name php 2>/dev/null and check where the php binary really is and if you have that directory on your PATH. – Fiisch Oct 28 '18 at 19:55
  • @Fiisch You are quite a legend. Post that and i'll accept. – IMB Oct 28 '18 at 20:07
  • Added as answer. :) – Fiisch Oct 28 '18 at 20:39
1

It depends from what repository those packages originate. For example, if you install something from SCL those packages typically go into /opt and therefore binaries do not (automatically) appear on PATH.

Simply run yum whatprovides */php or (more ugly but still my favorite) find / -name php 2>/dev/null and check where the php binary really is and if you have that directory on your PATH.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.