Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

aligajani's avatar

How do I use MYSQL_ATTR_SSL_CA in Vapor when .pem file is in storage?

It always get deleted when deployed to Vapor as the storage folder is purged.

'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA')
                    ? storage_path() . '/ssl/' . env('MYSQL_ATTR_SSL_CA')
                    : null,
            ]) : [],

I don't want to directly reference it to an s3/cdn asset URL as that will be too slow.

Any tips? PS: It works on local just fine, just not on Vapor.

0 likes
1 reply
aligajani's avatar

Maybe I can cache it on deployment, maybe I can access it directly via a configuration file?

Please or to participate in this conversation.