CumulusClips - Forums
Unable to locate path to PHP-CLI (not solved)
Hello all,
i'm a new french CumulusClips user, and sorry for my probably bad english.
I have successfully installed this script, and i can access to the webpage.
So, i'm unable to upload any video because "Unable to locate path to PHP-CLI" in Settings > Videos.
I use apache2 on Debian Jessie with VestaCP web hosting control panel.
I've tried
I try to put this result in the Settings > video textbox, and "Unable to locate...".
I've tried
If you have any suggest, i'm interested.
Thanks !
i'm a new french CumulusClips user, and sorry for my probably bad english.
I have successfully installed this script, and i can access to the webpage.
So, i'm unable to upload any video because "Unable to locate path to PHP-CLI" in Settings > Videos.
I use apache2 on Debian Jessie with VestaCP web hosting control panel.
I've tried
which php
and the result is /usr/bin/php
I try to put this result in the Settings > video textbox, and "Unable to locate...".
I've tried
whereis php
and the result is php: /usr/bin/php /usr/share/php /usr/share/man/man1/php.1.gz
. I try to put /usr/bin/php and /urs/share/php (with and without / at the end), and doesn't work.If you have any suggest, i'm interested.
Thanks !
Comments
/usr/bin/php --version
Next create a file named debug.php where index.php, with this content:
<?php
$phpPath = '/usr/bin/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;
Save it and access it from your browser, i.e. http://yoursite.com/debug.php. Also post here the output.
at first, thanks for your reply.
The first command return
PHP 5.6.30-0+deb8u1 (cli) (built: Feb 8 2017 08:50:21)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
The depub.php page show "File doesn't exist"
http://vid.abhd.fr/debug.php
In the Web panel official documentation website, we have a list of paths :
http://vestacp.com/docs/#config-log-location-debian-ubuntu
Thanks again
<?php
clearstatcache();
Then save and open the page again from your browser and post the results here.
<?php
clearstatcache();
$phpPath = '/usr/bin/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;
and same result : "File doesn't exist"
I already have tested just with
<?php
and he show a blank pageclearstatcache();
ls -l /usr/bin/php
In the debug file add this and run it from the browser:
<?php
$processUser = posix_getpwuid(posix_geteuid());
var_dump($processUser);
Then post the results.
lrwxrwxrwx 1 root root 21 Mar 9 05:09 /usr/bin/php -> /etc/alternatives/php
And my debug file is now
<?php
$processUser = posix_getpwuid(posix_geteuid());
var_dump($processUser);
clearstatcache();
$phpPath = '/usr/bin/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();
}
And the webpage show
array(7) { ["name"]=> string(5) "admin" ["passwd"]=> string(1) "x" ["uid"]=> int(1000) ["gid"]=> int(1000) ["gecos"]=> string(14) "adrien@abhd.fr" ["dir"]=> string(11) "/home/admin" ["shell"]=> string(9) "/bin/bash" } File doesn't exist
Webpage access : vid.abhd.fr/debug.php
ls -l /etc/alternatives/php
and post here the results.
lrwxrwxrwx 1 root root 13 Mar 9 05:09 /etc/alternatives/php -> /usr/bin/php5
i've tried with /usr/bin/php5 in php path on CumulusClips, but sill not work.
ls -l /usr/bin/php5
return-rwxr-xr-x 1 root root 9085672 Feb 8 10:07 /usr/bin/php5
If i understoud ?
/usr/bin/php -> /etc/alternatives/php -> /usr/bin/php5
It's a realy strange configuration !
I'm so sorry, i use a web hosting control panel for my server, because i host more friends's websites, and it's easy for use for us. Thanks again for your help.
In the meantime, now that we know the exact path of the binary run the debug script from your browser with this content, and post the results.
<?php
clearstatcache();
$phpPath = '/usr/bin/php5';
$failed = false;
if (!file_exists($phpPath)) {
echo "File doesn't exist<br>";
$failed = true;
}
if (!is_executable($phpPath)) {
echo "File isn't executable<br>";
$failed = true;
}
$phpCliResults = @exec($phpPath . ' -r "' . "echo 'cliBinary';" . '" 2>&1 | grep cliBinary');
if (empty($phpCliResults)) {
echo "Invalid CLI binary<br>";
$failed = true;
}
if (!$failed) echo "File is good!";
As I said, I'm still looking into this, I just want to see the output of the updated debugger.
File doesn't exist
File isn't executable
//if (!is_executable($phpExe)) continue;
Save the file and add /usr/bin/php5 in the Admin Panel -> Settings -> Video -> PHP Path field. See if it'll accept your values.
// Validate php-cli path
if (empty ($_POST['php'])) {
@exec('whereis php', $whereis_results);
$phpPaths = explode (' ', preg_replace ('/^php:\s?/','', $whereis_results[0]));
} else if (!empty ($_POST['php']) && file_exists ($_POST['php'])) {
$phpPaths = array(rtrim ($_POST['php'], '/'));
} else {
$phpPaths = array();
}
$phpBinary = false;
foreach ($phpPaths as $phpExe) {
// if (!is_executable($phpExe)) continue;
@exec($phpExe . ' -r "' . "echo 'cliBinary';" . '" 2>&1 | grep cliBinary', $phpCliResults);
$phpCliResults = implode(' ', $phpCliResults);
if (!empty($phpCliResults)) {
$phpCliBinary = $phpExe;
break;
}
}
if ($phpCliBinary) {
$data['php'] = $phpCliBinary;
} else {
$warnings['php'] = 'Unable to locate path to PHP-CLI';
$data['php'] = '';
}
and the message is
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.
$phpCliResults = implode(' ', $phpCliResults);
in that file, and add this right after it:
var_dump($phpCliResults);
Then try again with the /usr/bin/php5. It will output to the top of the screen. Post here the output.
// Validate php-cli path
if (empty ($_POST['php'])) {
@exec('whereis php', $whereis_results);
$phpPaths = explode (' ', preg_replace ('/^php:\s?/','', $whereis_results[0]));
} else if (!empty ($_POST['php']) && file_exists ($_POST['php'])) {
$phpPaths = array(rtrim ($_POST['php'], '/'));
} else {
$phpPaths = array();
}
$phpBinary = false;
foreach ($phpPaths as $phpExe) {
// if (!is_executable($phpExe)) continue;
@exec($phpExe . ' -r "' . "echo 'cliBinary';" . '" 2>&1 | grep cliBinary', $phpCliResults);
$phpCliResults = implode(' ', $phpCliResults);
var_dump($phpCliResults);
if (!empty($phpCliResults)) {
$phpCliBinary = $phpExe;
break;
}
}
if ($phpCliBinary) {
$data['php'] = $phpCliBinary;
} else {
$warnings['php'] = 'Unable to locate path to PHP-CLI';
$data['php'] = '';
}
The output is same : 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.
// Validate php-cli path
if (empty ($_POST['php'])) {
@exec('whereis php', $whereis_results);
$phpPaths = explode (' ', preg_replace ('/^php:\s?/','', $whereis_results[0]));
} else if (!empty ($_POST['php']) && file_exists ($_POST['php'])) {
$phpPaths = array(rtrim ($_POST['php'], '/'));
} else {
$phpPaths = array();
}
$phpBinary = false;
foreach ($phpPaths as $phpExe) {
// if (!is_executable($phpExe)) continue;
@exec($phpExe . ' -r "' . "echo 'cliBinary';" . '" 2>&1, $phpCliResults);
$phpCliResults = implode(' ', $phpCliResults);
var_dump($phpCliResults);
if (!empty($phpCliResults)) {
$phpCliBinary = $phpExe;
break;
}
}
if ($phpCliBinary) {
$data['php'] = $phpCliBinary;
} else {
$warnings['php'] = 'Unable to locate path to PHP-CLI';
$data['php'] = '';
}
i've tried with
2>&1,
and2>&1
and the error 500 persist.@exec($phpExe . ' -r "' . "echo 'cliBinary';" . '" 2>&1', $phpCliResults);
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.
and no more
apt-get install php5-cli