Run Laravel Commands with www-data user

Viewed 4273

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

1 Answers
Related