title: stream_socket_client() fails when using in CRON job
body: <p>I have a script that runs fine in the browser, however fails when run through CRON.</p>
  
  <p>Specifically, the script is using <code>stream_socket_client()</code> to create a secure socket, however despite running fine when I run through the browser, the CRON side fails with the following errors:</p>
  
  <blockquote>
    <p>PHP Warning:  stream_socket_client(): Failed to enable crypto in /var/www/vhosts/tweetheartsapp.com/httpdocs/API/testSend.php on line 18
    PHP Warning:  stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /var/www/vhosts/tweetheartsapp.com/httpdocs/API/testSend.php on line 18</p>
  </blockquote>
  
  <p>I am using the following command to run the CRON:</p>
  
  <pre><code>0-59 * * * * php -q httpdocs/API/testSend.php
  </code></pre>
  
  <p>Is there any reason for the problem via CRON? Can anyone give me any advice on how I can run this in CRON?</p>