title: PHP connection to remote mysql with ssl works via command but not in browser
body: <p>I want to connect to a <strong>remote</strong> (AWS) <strong>mysql</strong> server using <strong>ssl</strong> in <strong>PHP</strong>.</p>
  
  <p>My script works when I execute it via command line, but doesn't when I call it from the browser.</p>
  
  <pre><code>$con=mysqli_init();
  mysqli_ssl_set($con,NULL,NULL,"path/to/cacert.pem",NULL,NULL);
  $link = mysqli_real_connect($con, "host", "username", "password");
  </code></pre>
  
  <p>I am using <em>php7/Apache/CentOs</em>. I tried changing the <em>ownership</em> and <em>permissions</em> of the <em>CA file</em>, and noticed that it requires read permission the be executed on console. But in browser even if I give <em>full permission</em> to everybody (chmod 777) it still doesn't work.</p>
  
  <p>The error i get is:
  <strong>Warning: failed loading cafile stream.</strong>
  When I check existence of file it returns true, but when I check is_readible, then also error.</p>
  
  <p>Can somebody help?Thanks!</p>