title: CodeIgniter 3 - unable to load custom library in server
body: <p>Maybe this question is duplicate, but i'm already try from others discussion still can't resolve my problem. this code is working fine in my local mac, but can't load this library in hosting.</p>
  <p><code>application/libraries/Sitemap</code> im also try the filename and classname <code>MY_Sitemap</code></p>
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Sitemap {
  
    protected $ci;
    public function __construct()
    {
      $this-&gt;ci =&amp; get_instance();
      $this-&gt;ci-&gt;load-&gt;database();
    }
  
    public function create()
    {
      $sitemap = &quot;&lt;\x3Fxml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;\x3F&gt;\n&lt;urlset xmlns=\&quot;http://www.sitemaps.org/schemas/sitemap/0.9\&quot;&gt;\n&quot;;
  
      $blogs = $this-&gt;ci-&gt;db-&gt;select('*')-&gt;from('blog')-&gt;where('status', '1')-&gt;order_by('publish_date', 'DESC')-&gt;get()-&gt;result();
  
      foreach($blogs as $blog)
      {
         $sitemap .= &quot;\t&lt;url&gt;\n\t\t&lt;loc&gt;&quot; . site_url('blog/' . $blog-&gt;alias_en) . &quot;&lt;/loc&gt;\n&quot;;
      }
  
      $sitemap .= &quot;&lt;/urlset&gt;\n&quot;;
  
      $file = fopen('sitemap.xml', 'w');
      fwrite($file, $sitemap);
      fclose($file);
  
      return;
    }
  }
  </code></pre>
  <p>and in my controller:</p>
  <pre><code>&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Blog extends Admin_Controller {
  
      function __construct() { 
          parent::__construct();
          $this-&gt;load-&gt;library('Sitemap');
      }
      
      //to add a new blog 
      public function add() {
              // generate site map
              $this-&gt;sitemap-&gt;create();
      }
  
  </code></pre>