After installing wordpress and some plugins i am getting this error when i create a sitemap. I realy have no idea what this is and how to solve. Any help would realy be appreciated!

Warning: file_put_contents(/home/ugywhzos/domains/mydomain.com/public_html/sitemap.xml) [function.file-put-contents]: failed to open stream: Permission denied in /home/ugywhzos/domains/ipadkopen.biz/public_html/wp-content/plugins/simple-google-sitemap/simple-google-sitemap.php on line 283

And this error after editing a post:

Warning: file_put_contents(/home/ugywhzos/domains/mydomain.com/public_html/sitemap.xml) [function.file-put-contents]: 
failed to open stream: Permission denied in 
on line 283

Warning: Cannot modify header information - headers already sent by 
(output started at /home/ugywhzos/domains/mydomain/public_html/wp-content/plugins/simple-google-sitemap/simple-google-sitemap.php:283) 
in /home/ugywhzos/domains/mydomain.com/public_html/wp-includes/pluggable.php on line 897
  • 1
    Just to clarify something - Did you edit the warning messages when posting them here? The reason I ask is because in your first warning, the first URL string points to /home/ugywhzos/domains/mydomain.com/pub... but the second points to /home/ugywhzos/domains/ipadkopen.biz/pub.... If you didn't make the modification of "mydomain.com", we may have found our first problem. – Evan Wondrasek Apr 9 '11 at 22:56

If you already have the files sitemap.xml and (if you have gzip enabled in Simple Google Sitemap) sitemap.xml.gz in the root directory of your WordPress installation, try deleting them and create new empty files with the correct permissions for that plugin, then manually run the sitemap generator. If these files don't exist, try creating the files.

Here's how I would do it:

  1. Make sure sitemap.xml and sitemap.xml.gz don't exist in the root directory of your WordPress installation. If they do, delete them with rm sitemap.xml and rm sitemap.xml.gz over SSH, or just delete them through your FTP client of choice.

  2. Create two new blank instances of these files. Over SSH: touch sitemap.xml and touch sitemap.xml.gz. If you're doing this over FTP (I'll use WinSCP in this example, it's free), navigate to your root WordPress directory, right click, select New --> File and type sitemap.xml and sitemap.xml.gz, respectively.

  3. Set the file permissions of these files. I'd try 755 to start, but there may be a recommended value somewhere in this plugin's documentation. Over SSH: chmod 755 sitemap.xml and chmod 755 sitemap.xml.gz. If you're using FTP with WinSCP, right click the files, select Properties, and set the value of Octal to 0755 for each.

  4. In the Simple Google Sitemap settings (it's listed as XML-Sitemap in the WordPress settings menu), click the link "rebuild the sitemap" and see if it can now generate the sitemaps.

If I was to take a guess, I'd say both of those files don't exist right now and the Simple XML Sitemap plugin doesn't have permissions to create new files on your web server. Please let me know how it goes.

| improve this answer | |
  • The plugin documentation recommends 666, but indeed, you must create the file when installing the plugin. The docs don't talk about the gzipped version, best to leave it out then. – Jan Fabry Apr 10 '11 at 6:14

This error message comes when your php script does not have the write permissions for a folder. Best way to resolve this issue would be to ask your hosting provider to set the proper permissions for user under which your webserver is running.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.