I write a bash script to run the laravel envoy command in Elastic Beanstalk.
#!/bin/sh
cd /var/app/current/
sudo php vendor/bin/envoy run fillData &
And it gives errors as:
Unsuccessful command execution on the instance
And when accessing the EC2 terminal and running the command, it works fine with no errors.