When I try to execute php file from browser which have a command to start AWS ec2 instance I am getting error as ec2start command not found, but when I execute this file from command prompt in Ubuntu it works fine as I am executing this as a root but when I execute this file from browser it get execute with the apache user,
anybody knows the solution for this,
Thanks,
It is quite probable that your command line environment is different from PHP’s.
In order to do what you asked for, you need to specify ec2start with an absolute filename.
First run the following from your command prompt to find the path:
It should return a list of paths, just find the one containing ec2start.
Next, simply use that path you found inside your PHP script, like so: