nickola / web-console

:desktop_computer: Simple web-based shell in your browser (outdated)

Home Page:https://nickola.ru/projects/web-console

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP_BINARY not returning the correct value

killpond opened this issue · comments

If I run the following in Web Console...

php -r 'echo "PHP Path : ".PHP_BINARY;'

Expected result...

PHP Path : /usr/bin/php7.0

Actual result...

PHP Path :

If I then run the following in Web Console...

/usr/bin/php7.0 -r 'echo "PHP Path : ".PHP_BINARY;'

I get...

PHP Path : /usr/bin/php7.0

If I then run the following via SSH on the server as the web user (It is a docker container fresh Ubuntu image)...

php -r 'echo "PHP Path : ".PHP_BINARY;'

I get...

PHP Path : /usr/bin/php7.0

The server has a number of symbolic links involved in the PHP look up but ultimately it is just a standard PHP7 APT Ubuntu install...

$ ls -la /usr/bin/php
lrwxrwxrwx 1 root root 21 Nov 20 15:26 /usr/bin/php -> /etc/alternatives/php

$ ls -la /etc/alternatives/php
lrwxrwxrwx 1 root root 15 Nov 20 15:26 /etc/alternatives/php -> /usr/bin/php7.0

$ ls -la /usr/bin/php7.0
-rwxr-xr-x 1 root root 4430896 Aug  9 14:43 /usr/bin/php7.0