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

gvancout created an issue.

gvancout’s picture