title: Captcha Helper Codeigniter Error - imagettftext(): Could not find/open font
body: <p>please help me solve this problem.
  I want to use the captcha in my login page using captcha helper in CodeIgniter, but got some error like this :</p>
  <blockquote>
  <p>A PHP Error was encountered</p>
  <p>Severity: Warning</p>
  <p>Message: imagettftext(): Could not find/open font</p>
  <p>Filename: helpers/captcha_helper.php</p>
  </blockquote>
  <p>=============================================</p>
  <p>this is my controller :</p>
  <pre><code>public function login() {
  
      $data['captcha'] = $this-&gt;set_captcha();
      $this-&gt;load-&gt;view('access/login', $data);
  
  }
  
  public function set_captcha() {
  
      $vals = array(
          'img_path'      =&gt; './assets/img/captcha/',
          'img_url'       =&gt; base_url('assets/img/captcha'),
          'font_path'     =&gt; './assets/fonts/Kalam-Regular.ttf',
          'img_width'     =&gt; 175,
          'img_height'    =&gt; 55,
          'expiration'    =&gt; 3600,
          'word_length'   =&gt; 5,
          'font_size'     =&gt; 17,
          'pool'          =&gt; '0123456789abcdefghijklmnopqrstuvwxyz',
  
          // White background and border, black text and red grid
          'colors'        =&gt; array(
              'background' =&gt; array(255, 255, 255),
              'border' =&gt; array(255, 255, 255),
              'text' =&gt; array(160, 160, 160),
              'grid' =&gt; array(255, 183, 206)
          )
      );
  
      $cap = create_captcha($vals);
  
      return $cap['image'];
  
  }
  </code></pre>
  <p>and then I just echo the captcha variable in the view.</p>
  <p>the problem is only show in windows (XAMPP) but not in my ubuntu server.
  please tell me if any duplicate of this post, I have searched the list of posts &amp; google but did not find the same problem.</p>