Trouble uploading images to AWS s3 and XAMPP

So I needed to get my local xampp development site working with AWS s3 to store images.  I had it set up and working on my development server but I needed my local development to work as well. Unfortunately I kept getting this error.

Aws\S3\Exception\S3Exception with message ‘Error executing “ListObjects” on “https://mybucket.s3-ap-southeast-2.amazonaws.com/?prefix=&delimiter=%2F&encoding-type=url”; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)’

I Googled for a solution and everywhere I found that I needed to change my php.ini file to include a certificate. Unfortunately everywhere told me to get a clean cacert.pem and do the following in the php.ini file.

curl.cainfo=C:\path\to\cert\cacert.pem

This did not work for me.  More searching and a bit of trial and error lead me to this.

openssl.cafile=C:\path\to\cert\cacert.pem

And badda-bing badda-boom it works!

Hope this helps someone save some hours.

Laravel Dom PDF issues with font awesome and a Unicode work around

So I am using Laravel-DomPDF by Barryvdh in my Laravel 5.4 project, which makes it super easy to create PDF documents from Laravel Views.

Kudos to Barryvdh for providing a simple way to produce PDF documents from Laravel.

So, I wanted to pull Font Awesome into the blade view for a couple of icons I had on the page.  Problem was that it was not working.  I tried everything suggested from full url for the link, to adding a fonts folder to /storage/app.  None worked for me.

As I only need a tick and an exclamation on the page I decided to add the styles straight into the head of my blade file and use Unicode.

I found that Dom PDF already pulls in DeJaVu Fonts which is a project that is aiming for complete coverage of alphabetic scripts. The other thing is that it has a bunch of symbols.  Not as awesome as Font Awesome but enough for my needs.

In between the head tags I added this.

<style>
.fa-check:before {
            font-family: DejaVu Sans;
            content: "\2611";
            color:darkgreen;
            font-size:1.2rem;
}
.fa-exclamation-triangle:before{
            font-family: DejaVu Sans;
            content: "\26A0";
            color:darkorange;
            font-size:1.2rem;
 }
</style>

This is the check:

And this is the exclamation:

Neat hey! Where did I get the content:”\????” from?

Miscellaneous_Symbols

This was a quick and dirty solution to my issue and may help you.  While I agree it’s not ideal it is better than changing to another PDF project or spending more time trying to get this to work with Font Awesome at the moment.