bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

MySQL and SSLMODE #1208

Closed adamsewell closed 3 years ago

adamsewell commented 3 years ago

I've written an app in F3 that I'd like to utilize DigitalOcean's managed database on, and to do that they require SSL mode for SQL connections. I can't seem to find a way to enable that with F3. Trying straight out just gives an error that it's trying to connect with an unknown method. In WordPress, I just had to place define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL); Is there a similar setting in F3?

Thanks!

ikkez commented 3 years ago

Yes sure. You can setup to use SSL with PDO_MYSQL. Please see DB constructor options here: https://fatfreeframework.com/3.7/sql#Constructor and PDO attributes for SSL here: https://www.php.net/manual/en/ref.pdo-mysql.php#pdo-mysql.constants