Reputation: 41
I'll start by saying I am very new to linux in general. What I have is a php script I wrote that fetches images from posts on reddit.com hides the post and adds the link to an array, then saves all the images in the array. when I type something like: "php cron.php" as root it runs fine, but whenever crontab runs it the script only hides all the posts but never saves the images. To me it sounds like a problem with permissions by the cron user. Ive been messing with it for hours and recently changed it the www-data user's crontab with: "su -l www-data -c 'crontab -e'" but still no cigar, since its a cron job I suppose its running silently and not giving me any errors. If anyone could show me how to display these messages it would surely help debugging. Thanks.
Upvotes: 0
Views: 1113
Reputation: 24156
you're running php cron.php under yourself, but cron works under different user and even if you're trying to run it under www-data it is still different user from yourself
simple solution: check what right has folder where php tries to write, set them to 0777 to test, check if cron script is successful
then you can have different options, like - set folder's owner to cron and set 0755 or move cron user to the same group as you're
Upvotes: 3