0

I have a script that calls an API and, grabs photos and saves them to the server. It works wonderfully if I execute it from SSH. But when it's running as a Scheduled Task, I receive a failed to open stream: Permission denied

This is what I'm running as my scheduled task:

/usr/bin/php /var/www/vhosts/mywebsite.com/laravel/artisan get_photo

Again, running this script as php artisan get_photo from Terminal through SSH works wonders. I can't figure out why I would be getting Permission denied when it's being run as a Scheduled Task.

4

1 回答 1

0

发生这种情况的原因是因为当我通过 SSH 运行脚本时,用户是“root”......这当然不是“请计划任务”用来运行命令的用户。

呃!

于 2015-03-11T18:17:02.750 回答