I'm trying to execute some shell commands from browser. But whenever i do so, I get "php is not recognized as external or internal command" error whereas it works fine in the terminal. I tried looking for it on the web and found something related to "www-data" user which I couldn't possibly understand. Can you please help me figure out what could be the issue with the given below code?
<?php
shell_exec("php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\"");
shell_exec("php composer-setup.php --install-dir=" . $this->binPath . " --filename=composer");
shell_exec("php -r \"unlink('composer-setup.php');\"");
I'm expecting the shell_exec command to download and install composer for me at the desired location.