title: How to Generate a QR code using PHP?
body: <p>I am attempting to turn some data into a QR on a webpage. To do this I am using 'php qrcode'.</p>
  
  <p>Sourceforge Home Page of library: <a href="http://phpqrcode.sourceforge.net/" rel="nofollow noreferrer">http://phpqrcode.sourceforge.net/</a></p>
  
  <p>I am unable to generate the QR code using the library. Am I missing a PHP extension. </p>
  
  <p>Thinking I was missing the GD2 extension, I did:</p>
  
  <pre><code>brew install gd
  </code></pre>
  
  <p>Current Code:</p>
  
  <pre><code>  include( '../phpqrcode/qrlib.php' );
    QRcode::png( 'PHP QR Code : )' );
  </code></pre>
  
  <p>Current Output:</p>
  
  <p>�PNG  IHDRWWKK/PLTE���U��~�IDAT8��ұ � PG.�N�t�tـ,V��H,pe�����4Ĵq�k�� ��j���'^l�����p�h�Sn�8D>3T-�%�����:\��z���4{oL��!C�-����_o�r���r��m��x+��,}��ő��|i����ʚt{oZ6\,i�{�5몏{���Ϫ����/MIEND�B`�</p>
  
  <p>Edit: 
  I have tried changing the html header to image/png. Same results.</p>
  
  <pre><code>   &lt;meta http-equiv="content-type" content="image/png" charset="UTF-8"&gt;
  </code></pre>
  
  <p>Edit: Full Sample Code, Same results, no QR code.</p>
  
  <pre><code>&lt;?php header('Content-type: image/png'); ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en" dir="ltr"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="content-type" content="image/png" charset="utf-8"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php
  
  include( '../phpqrcode/qrlib.php' );
  QRcode::png( 'PHP QR Code : )' );
  
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Edit: The following shows same results </p>
  
  <pre><code>&lt;?php
  header('Content-type: image/png');
  
  include( '../phpqrcode/qrlib.php' );
  QRcode::png( 'PHP QR Code : )' );
  ?&gt;
  </code></pre>
  
  <p>Edit:
  Using laravel framework</p>