sitemap icon indicating copy to clipboard operation
sitemap copied to clipboard

/sitemap.xml throws a 500 error

Open jordanmoore opened this issue 9 years ago • 1 comments

I'm not sure why it's happening on my live server as the sitemap works fine locally. But from the root folder if I visit /sitemap.xml in Chrome I see the XML file trying to render for a split second before throwing a 500 error.

jordanmoore avatar Jul 13 '16 11:07 jordanmoore

@jordanmoore I had the same issue, so I looked at the /craft/runtime/logs/craft.log to find this:

******************************************************************************************************
2017/10/09 16:32:13 [error] [exception.Error] Error: Class 'DOMDocument' not found in /var/www/craft/craft/plugins/sitemap/services/SitemapService.php:58
Stack trace:
#0 /var/www/craft/craft/app/framework/base/CComponent.php(111): Craft\SitemapService->getSitemap()
#1 /var/www/craft/craft/plugins/sitemap/controllers/Sitemap_SitemapController.php(23): CComponent->__get('sitemap')
#2 /var/www/craft/craft/app/framework/web/actions/CInlineAction.php(49): Craft\Sitemap_SitemapController->actionOutput()
#3 /var/www/craft/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#4 /var/www/craft/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#5 /var/www/craft/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#6 /var/www/craft/craft/app/framework/web/CWebApplication.php(282): CController->run('output')
#7 /var/www/craft/craft/app/framework/web/CWebApplication.php(141): CWebApplication->runController('sitemap/sitemap...')
#8 /var/www/craft/craft/app/etc/web/WebApp.php(290): CWebApplication->processRequest()
#9 /var/www/craft/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#10 /var/www/craft/craft/app/index.php(62): CApplication->run()
#11 /var/www/craft/public/index.php(25): require_once('/var/www/craft/...')
#12 {main}
REQUEST_URI=/sitemap.xml
---

Which lead me to find this: https://stackoverflow.com/questions/14395239/class-domdocument-not-found

And just running sudo apt-get install php7.0-xml was enough to get it working. Hope this helps!

MikeMcChillin avatar Oct 09 '17 16:10 MikeMcChillin