0

I installed php7.1 using the iuscommunity repo. It works fine and I can run php files via apache normally e.g. http://example.com/test.php, however I cannot find the executable, if I run:

php -v
-bash: php: command not found

If I look at the php constants, the path shows but not the binary. There is no php binary in my /usr/bin:

var_dump(PHP_BINARY);
var_dump(PHP_BINDIR);
// result:
string(0) ""
string(8) "/usr/bin"

If I use find I get the below results, but none of them are the php binary. If I try to execute them it tells me it's a directory.

find / -name php -print

/var/lib/php
/usr/lib64/php
/usr/share/php

How can I find my php 7.1 binary? I need it to run php from the CLI.

user69904
  • 231
  • 3
  • 12

2 Answers2

2

Thanks to @ceejayoz for pointing out that the CLI can be a seperate package.

I installed php71u-cli:

yum install php71u-cli

Now I can run php -v successfully.

user69904
  • 231
  • 3
  • 12
0
  1. locate PHP bin directory
  2. create link to /usr/bin

In my case my php installed in "/opt/php/bin". So i just create link "ln -s /opt/php/bin/php /usr/bin/php". After this i can run php -v