I made a command in Laravel 5.1 that is supposed to delete some directories from the file system.
in the handle()
method of the command class, i did shell_exec("whoami")
and it returns raheel
. However the user raheel
has no permission on the specified directory. I want to run this command as apache www-data
user.
How can i implement this in Laravel ?
Thanks
This is how I'm running my crons:
su -c "php artisan schedule:run >> /dev/null 2>&1" -s /bin/sh www-data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With