Unable to locate path to PHP-CLI

I have an Webserver running Plesk Onyx.
PHP 5.6.30 is Active

But PHP CLI is not found.
I try to activate it manually but it doesn Work
Is someone with an idea?

cmulus@server:/opt/plesk/php/5.6/bin$ pwd
/opt/plesk/php/5.6/bin

cmulus@server:/opt/plesk/php/5.6/bin$ /opt/plesk/php/5.6/bin/php -v
PHP 5.6.30 (cli) (built: Jan 20 2017 12:17:19)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v6.0.7, Copyright (c) 2002-2016, by ionCube Ltd.
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Comments

  • In Admin Panel - Settings - Video - PHP Path set the value to /opt/plesk/php/5.6/bin/php and save.
  • Hi Damian,

    i have tried

    Settings have been updated, but there are notices.
    Notice:

    The following requirements were not met. As a result video uploads have been disabled.

    - Unable to locate path to PHP-CLI
    If you're using a plugin or service for encoding videos you can ignore this message.
  • i Think the error is while php7 is in the default path, but php5.6 is not


    root@server:~# whereis php
    php: /usr/bin/php /usr/bin/php7.0 /usr/lib/php /etc/php /usr/share/php7.0-curl /usr/share/php7.0-opcache /usr/share/php7.0-common /usr/share/php7.0-mbstring /usr/share/php7.0-xml /usr/share/php7.0-gd /usr/share/php7.0-json /usr/share/php7.0-readline /usr/share/php /usr/share/php7.0-mysql /usr/share/php7.0-sqlite3 /usr/share/php7.0-imap /usr/share/man/man1/php.1.gz


    But its ignores the PHP Path in the Admin Panel
  • I changed the default PHP CLI on The Server with this script.
    https://gist.github.com/vjandrea/132a15186fa0193fb764


    cmulus@server:~$ php -v
    PHP 5.6.30 (cli) (built: Jan 20 2017 12:17:19)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v6.0.7, Copyright (c) 2002-2016, by ionCube Ltd.
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies


    But it dont work in Admin Panel from Cumulus
  • edited February 10
    I created a quick and dirty test for you to execute in order to debug the issue. In the following snippet, replace the "/path/to/your/php" with your actual PHP CLI path (the one you're entering in the Admin Panel. Save the snippet contents as "debug.php" on your server and execute like this:

    php debug.php

    Let me know what the result is. Here are the file contents:

    <?php

    $phpPath = '/path/to/your/php';

    if (!file_exists($phpPath)) {
    echo "File doesn't exist" . PHP_EOL;
    exit();
    }

    if (!is_executable($phpPath)) {
    echo "File isn't executable" . PHP_EOL;
    exit();
    }

    $phpCliResults = @exec($phpPath . ' -r "' . "echo 'cliBinary';" . '" 2>&1 | grep cliBinary');
    if (empty($phpCliResults)) {
    echo "Invalid CLI binary" . PHP_EOL;
    exit();
    }

    echo "File is good!" . PHP_EOL;

  • $phpPath = '/opt/plesk/php/5.6/bin/php';



    root@server:/opt/plesk/php/5.6/bin# php debug.php
    File is good!
  • Ok, can you try hitting the file from your browser to see if you get the same result. Should be something like http://your-site.com/debug.php. Actual URL depends on where you placed the file.
  • File doesn't exist
  • That is your problem. Your web browser isn't able to utilize the PHP binary which you provided. That is why the test returned "File doesn't exist" and why it won't accept it in the admin panel.
Sign In or Register to comment.