I just upgraded to the latest 6.x-dev and got this error in multiple pages.
Fatal error: Class 'XMLWriter' not found in .../sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc on line 12
I just upgraded to the latest 6.x-dev and got this error in multiple pages.
Fatal error: Class 'XMLWriter' not found in .../sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc on line 12
Comments
Comment #1
antiorario commentedHere's what I get—it sounds related:
Also, sitemap files return a 404. That happens only in one installation. Two more installations seem to have no problems.
Comment #2
dave reid@EnekoAlonso: What version of PHP are you using? The XMLWriter class should be provided by default in PHP 5.1+ so if you're missing that it's a big problem.
@antiorario: Your issue is not related as the XMLWriter class can be found. Does this installation happen to be on Windows? Also double check that your sites's sites/default/files/xmlsitemap directory is writeable by your webserver (going to admin/reports/status should be able to tell if you if is or not).
Comment #3
antiorario commentedIt's a regular LAMP installation. The xmlsitemap directory is writable, and in fact the module does create the correct subfolders, but it seems unable to create the proper XML files inside them. What is weird is that I have pretty much the same setup on two installations, one of which works properly and the other doesn't. For the time being, I've moved back to the beta, so all is working properly.
Comment #4
wxman commentedJust adding that I had this same problem after the Oct 07 update. I had to go back to the previous version that I had saved. Now it's working fine.
Comment #5
Anonymous (not verified) commentedI'm not sure whether this is related or not but I've been seeing the same error on an Ubercart site with 6.x-2.0-beta1. Then discovered that the Default Base URL in /admin/settings/xmlsitemap/settings had been set to "https" rather than "http". When I changed it, the error disappeared.
Comment #6
andrewfn commentedThis error is quite common on CentOS / RHEL systems because php-xml is not compiled by default. However it is very easy to add it in as a module:
Comment #7
nasirbest commented@andrewfn
Thanks! that was the problem, now it working
Comment #8
dave reidWe've added a requirements check that checks to make sure the XMLWriter class is available now.
Comment #10
promesFor a site with several domains (domain acces module is active) I need the domain-xmlsitemap which needs the 2.0 version.
Today I installed the current offial version 6.x-2.0-beta2 and still have the same errormessage. Also I tried it with the current 6-dev version.
I use PHP version 5.1.6 with the following XML extensions enabled / active:
- DOM/XML
- libxml
- SimpleXML
- xml (XML support, XML namespace support).
The site runs on a external shared server (Apache), so I am not able to install the extras from #6 myself.
I php-xml some additional module the hosting company should install? If so, a lot of future users will have problems using this version since several hosting providers are not willing to install specific software.
I thank you for a module I use in all my Drupal sites. I will be pleased with your advice.
Comment #11
promesResetting status
Comment #12
Anonymous (not verified) commentedMe too. See admin/reports/status for more information about the requirements for this module and PHP. This is a user environment issue.
Comment #13
promesThe problem is: when I enable the sitemapmodule and go to admin/reports/status I only get this warning: Fatal error: Class 'XMLWriter' not found in /var/www/html/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc on line 12.
So please state all the requirements on a readeble place. These are not in the readme nor on the project page. The only requirement found above: php-xml.
That's the reason I asked for advice and did give a warning not everybody is able to install additional php-modules.
Comment #14
vewakayeh commentedi am confused..
First I install the 6.x-2.x-dev in a server without php-xml installed and work without errors (is that normal?)
Second I install the customerror module the i got white screen and apache logs says PHP Fatal error: Class 'XMLWriter' not found in /home/emporoip/public_html/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc on line 11, referer: http://192.168.1.65/admin/settings/xmlsitemap/settings.
But when i tried the same steps to another identical setup both modules work without the XMLWriter error.
So... is it safe to use this module to a shared hosting server without php-xml installed or not???
also i agree with promes (#13) that this requirements it would be very useful to be on a readable place because not everybody is able to install additional php-modules.
Comment #15
dave reid@vewakayeh: If you're using 6.x-2.0-beta2 you should see if there is a problem with the requirements at the place you should always be checking: admin/reports/status.
Comment #16
dalegrebey commentedMaking sure that the xmlsitemap folder was writeable is what resolved this issue for me.
Comment #17
fgmJust got this on the last D6 version during a D5 (!) upgrade: this happened because PHP 5.6 had a dummy xmlwriter config.
sudo apt-get install php5.6-xmlfixed it for me.Comment #18
satinder commentedI recently got the same issue with an old Druoal 6 installation, and solution provided by @fgm helps me to fix the problem.
Thanks
Comment #19
fgmMaybe we should add this to the module README ?