title: Communicate with APNS from PHP
body: <p>I would like to communicate with the Apple Push Notification Service from a PHP script. 
  But I keep getting following error:</p>
  
  <blockquote>
    <p>Warning: stream_socket_client(): Unable to set private key file</p>
  </blockquote>
  
  <p>I have a .pem-file which looks like this:</p>
  
  <pre><code>-----BEGIN CERTIFICATE-----
       Encrypted String
  -----END CERTIFICATE-----
       Bag Attributes
       friendlyName: ...
       localKeyID: ...
       Key Attributes: ...
  -----BEGIN RSA PRIVATE KEY-----
       Proc-Type: ...
       DEK-Info: ...
  
       Encrypted String
  -----END RSA PRIVATE KEY-----
  </code></pre>
  
  <p>I am running the PHP script from sudo. It can find my <code>.pem file</code>, because if I remove it, I get a <code>"handshake failure"</code> error instead.</p>
  
  <p>What could be wrong here?</p>