Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
XMLSitemapGenerationException: Could not open file public://xmlsitemap/g3XYqcXbSKPVBDODwnT6pq7oqhCFkPryj4vVqrl_Kfc/1.xml for writing
On an AS400 with Zendserver, the path returned by xmlsitemap_sitemap_get_file($sitemap, $page) is not working properly, I needed to add the realpath and remove 'public://' from the path in order to make it work.
if ($wrapper = file_stream_wrapper_get_instance_by_uri('public://')) {
$realpath = $wrapper->realpath();
}
$filepath = substr(xmlsitemap_sitemap_get_file($sitemap, $page), 9); // remove 'public://'
$this->uri = $realpath.'/'.$filepath;
$this->openUri($this->uri);
Comments
Comment #2
gvancout CreditAttribution: gvancout commented