I am new to php and I am getting this error trying to load a cert
jameys-macbookpro41:~ user$ php -f ~/Sites/providerService.php
Warning: s
You are getting an error because it's trying to find your cert.pem file in the directory you are running the script from, not the directory the script is in. In your example, it is your user directory "~".
Try changing your class to this, or something similar:
class pushNotifications {
...
private $sslPem = 'cert.pem';
...
function connectToAPNS(){
$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', dirname(__FILE__) . '/' . $this->sslPem);