title: Pusher with PHP And Javascript
body: <p>I want to implement pusher with php and javascript.</p>
  
  <p>I have included pusher library for php with composer.</p>
  
  <p>And my php code is </p>
  
  <pre><code>&lt;?php
  require_once "vendor/autoload.php";
  
  $app_id = "XX";
  $app_key = "XX";
  $app_secret = "XX";
  $cluster = "ap1";
  
  $pusher = new Pusher( $app_key, $app_secret, $app_id, array( 'encrypted' =&gt; true ) );
  
  $pusher-&gt;trigger( 'XX-channel', 'test', 'hello world' );
  </code></pre>
  
  <p>And in javascript </p>
  
  <pre><code>&lt;head&gt;
      &lt;title&gt;Pusher&lt;/title&gt;
      &lt;script src="https://js.pusher.com/4.1/pusher.min.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;script type="text/javascript"&gt;
          const socket = new Pusher("XXX", {
              cluster: 'ap1'
          });
          const channel = socket.subscribe('XX-channel');
  
          channel.bind('test', function (data) {
            console.log(data);
          });
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>But when I refresh page I dont receive any console logs.</p>
  
  <p>Any idea what might be wrong?</p>