ds34222 2015-03-11 17:19
浏览 97

权限被拒绝作为命令但不是来自终端中的SSH

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.

  • 写回答

1条回答 默认 最新

  • dongping4901 2015-03-11 18:17
    关注

    The reason this was happening was because when I ran the script through SSH, the user was "root" ... which of course is not the same user that the Please Scheduled Tasks uses to run the command.

    DUH!

    评论

报告相同问题?

悬赏问题

  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序