title: openssl_x509_export_to_file : cannot get cert from parameter 1
body: <p>I have an Apple Push Notification Development Push SSL Certificate generated by iOS Dev Center, by a certificate signing request .</p>
  
  <p>I would like to use a PHP to convert certificate format. In Terminal / shell, I can execute this command to convert the certificate format :</p>
  
  <pre><code>openssl x509 -in aps_developer_identity.cer -inform der -out push_cert.pem
  </code></pre>
  
  <p>In PHP, I have:</p>
  
  <pre><code>$result = openssl_x509_export_to_file('/path/to/aps_developer_identity.cer', '/path/to/push_cert.pem');
  </code></pre>
  
  <p>However, PHP issues a warning:</p>
  
  <pre><code>openssl_x509_export_to_file() : cannot get cert from parameter 1
  </code></pre>
  
  <p>In <a href="http://www.php.net/manual/en/openssl.certparams.php" rel="nofollow">PHP documentation</a>, it said that the 1st parameter can be file path to the certificate file.</p>
  
  <p>Given that:</p>
  
  <ul>
  <li>the certificate exists and accessible by the PHP script, </li>
  <li>the output path is valid and has write permission, and</li>
  <li>PHP openssl module is installed</li>
  <li>using PHP 5.3.10</li>
  <li>using Ubuntu 12.04 LTS</li>
  </ul>
  
  <p>What could be the problem?</p>