XML Sitemaps Generator

Author Topic: Warning: fclose(): supplied argument is not a valid stream resource  (Read 23428 times)

Len2003

  • Registered Customer
  • Jr. Member
  • *
  • Posts: 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: [external links are visible to admins only]
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

XML-Sitemaps Support

  • Administrator
  • Hero Member
  • *****
  • Posts: 9567
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #1 on: October 17, 2008, 09: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
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.

Len2003

  • Registered Customer
  • Jr. Member
  • *
  • Posts: 13
  • Have a nice day.
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #2 on: October 18, 2008, 11:25:59 AM »
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



XML-Sitemaps Support

  • Administrator
  • Hero Member
  • *****
  • Posts: 9567
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #3 on: October 19, 2008, 08: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.
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.

Len2003

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

Regards
Len

 :)

XML-Sitemaps Support

  • Administrator
  • Hero Member
  • *****
  • Posts: 9567
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #5 on: October 20, 2008, 01:57:45 PM »
That's correct. The files will be recreated when you generate sitemap via cron task next time.
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.

Len2003

  • Registered Customer
  • Jr. Member
  • *
  • Posts: 13
  • Have a nice day.
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #6 on: October 20, 2008, 10: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

 :)

XML-Sitemaps Support

  • Administrator
  • Hero Member
  • *****
  • Posts: 9567
Re: Warning: fclose(): supplied argument is not a valid stream resource
« Reply #7 on: October 21, 2008, 09:12:54 PM »
Hello,

I'm glad that worked!

Existing files should have permissions unchanged when generating sitemap next time.
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.

 

SMF 2.0.7 | SMF © 2011, Simple Machines
XHTML RSS WAP2