Len2003

*
  • *
  • 13
  • Have a nice day.
I've recieved many warnings in my cron job email.
Think it has to do with permissions.
Can you please help.

Code: [Select]
Warning: fwrite(): supplied argument is not a  valid stream resource in  /home/migrant/public_html/generator/pages/class.xml-creator.inc.php(2) :  eval()'d code on line 177
Warning: fclose(): supplied argument is not a  valid stream resource in  /home/migrant/public_html/generator/pages/class.xml-creator.inc.php(2) :  eval()'d code on line 181

Creating HTML sitemap...
Warning:  fopen(/home/migrant/public_html/generator/data/sitemap.html): failed to open  stream: Permission denied in  /home/migrant/public_html/generator/pages/class.html-creator.inc.php(2) :  eval()'d code on line 149

Warning: fwrite(): supplied argument is not a  valid stream resource in  /home/migrant/public_html/generator/pages/class.html-creator.inc.php(2) :  eval()'d code on line 150

Warning: fclose(): supplied argument is not a  valid stream resource in  /home/migrant/public_html/generator/pages/class.html-creator.inc.php(2) :  eval()'d code on line 151

Regards
Len
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #1 on: October 17, 2008, 10:44:58 PM »
Hello,

make sure that you have all permissions set correctly:
/ror.xml and /sitemap.xml - 0666
/generator/data/ folder - 0777
all files inside /generator/data/ folde r- 0666

Len2003

*
  • *
  • 13
  • Have a nice day.
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #2 on: October 18, 2008, 12:25:59 PM »
Hi
Below is a screen capture of my FileZilla ftp program and it’s showing the files that are within the Data folder. I ‘being mig’ was only able to reset some of the files permissions from 644 to 666 ‘as advised’ but 16 of the files within are not owned by me ‘Owner being 99 99’ so I was unable to reset them, the current permissions for those 16 files are 644. Will I need to change them?

Regards
Len


Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #3 on: October 19, 2008, 09:10:27 PM »
Hello,

as you see, you have different Owner UID/Group for script running in browser and the same script in command line (cron job), that's why permissions are different too.
In  this case you can simply remove those files and let scheduled task re-generate sitemap.

Len2003

*
  • *
  • 13
  • Have a nice day.
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #4 on: October 20, 2008, 12:01:31 AM »
Just to verify. Your saying empty/ remove all files from the Data folder.

Regards
Len

 :)

Len2003

*
  • *
  • 13
  • Have a nice day.
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #6 on: October 20, 2008, 11:06:09 PM »
Thank you for your help. It’s been very much appreciated.

I cleared the data folder and have just received my cron email notification and this time, no more warnings.   :)

I’ve also re-checked the data folder and as you say, all the files have been recreated, only this time, under only one owner/group.   :)


There is one thing though. All the recreated files in the Data folder have their permissions set at 644, so as advised earlier, I’ve now changed them to 666.
Will I need to reset these files to 666 each time the cron has run or is it, that once I’ve changed them to 666 I won’t need to change them again?

Regards
Len

 :)
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #7 on: October 21, 2008, 10:12:54 PM »
Hello,

I'm glad that worked!

Existing files should have permissions unchanged when generating sitemap next time.