Hayate
Hayate

Reputation: 693

Is PHP_BINARY correct in PHP 7.0.11 fpm?

I use Ubuntu 16.10. In cli mode PHP_BINARY has value /usr/bin/php7.0. If php7.0-fpm working, PHP_BINARY has value /usr/sbin/php-fpm7.0 and i can't use this value as php cli executable. Is this correct behavior? Or this bug?

Upvotes: 0

Views: 444

Answers (1)

mystery
mystery

Reputation: 19513

The PHP_BINARY constant tells you the path of the PHP interpreter the code is running in. Therefore, if you are running in FPM, you will get the FPM binary; if you are running in CLI, you will get the CLI binary; and so on.

If you need to call the CLI binary, PHP can't help you here. There is no guarantee in an FPM context that the CLI binary is even installed, they're completely separate.

Upvotes: 2

Related Questions