An installer reports a required tool as missing, even though it's installed
Why an application's own setup wizard can wrongly report Composer, npm, or a similar tool as unavailable, and the exact edit to resolve it.
Some applications' setup wizards check, as one of their first steps, whether certain command-line tools are present on the server - Composer and npm are common examples. If that check reports a tool as missing even though you know it's genuinely installed, this is almost never actually true: the check itself can't run the way it expects to on this server, and the right fix is very rarely to change anything about what's installed.
Why the check fails
A check like this works by asking the server to run a shell command and read back the answer - typically something built around PHP's shell_exec(), exec(), or system(). Running arbitrary shell commands from a web application is also one of the most common ways a compromised or vulnerable application is used to attack the rest of a server, so those functions are switched off for every hosting account by default. That's a deliberate, permanent security setting, not a bug - the same protection described in the article on restricted file paths in this section, applied to running commands instead of reading files.
An account using its own isolated PHP environment adds a second, independent reason the same check can't succeed: that account's PHP can only see its own files, not the rest of the server, so even a command it was allowed to run couldn't find a tool living outside its own folder anyway.
What to actually check first
Confirm what the application genuinely needs the tool for. Composer and npm are almost always used only to install an application's dependencies once, a step usually already done before or during deployment - the application running day to day afterward doesn't call either one itself. If the application's own vendor/dependency folder is already present and populated, that's what actually matters, not whether the installer can see the tool that built it.
The fix
Open the file the error message names, through the File Manager for that account. It will contain a function along these lines:
function commandExists($cmd) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$return = shell_exec("where $cmd");
} else {
$return = shell_exec("which $cmd");
}
return !empty($return);
}
Since the dependencies are already in place and this check was only ever going to be refused by the server's security settings, replace the whole function body with a plain "yes":
function commandExists($cmd) {
return true;
}
Save the file and reload the installer's requirements step. The tool should now show as satisfied.