title: Sending iOS notification through a php script: 'Unable to set private key file'
body: <p>I have used the php script from the well known Ray Wanderlich <a href="http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1" rel="noreferrer">tutorial</a> to send push notifications during development phase. They were triggered properly after I created the pem file (from the p12 and aps_development.cer file) and mentioned the device token in the php script.</p>
  
  <p>However, when I am using a pem file which has production p12 and aps_production.cer file, the notification is not even reaching the APNS server. It is showing the below error at the local server end itself.</p>
  
  <pre><code>Unable to set private key file `/Users/administrator/Desktop/SimplePush/ck.pem' in /Users/administrator/Desktop/SimplePush/simplepush.php on line 22
  
  Warning: stream_socket_client(): failed to create an SSL handle in /Users/administrator/Desktop/SimplePush/simplepush.php on line 22
  
  Warning: stream_socket_client(): Failed to enable crypto in /Users/administrator/Desktop/SimplePush/simplepush.php on line 22
  
  Warning: stream_socket_client(): unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /Users/administrator/Desktop/SimplePush/simplepush.php on line 22
  </code></pre>
  
  <p>What could be the reason for it. The p12 file does not have any password (though I have configured a password for the pem file) and this is how it has been given in the php script.</p>
  
  <pre><code>// Put your private key's passphrase here:
  $passphrase = '';
  </code></pre>