From c8082d3c970a322adf26b31ed2735f85795f86f8 Mon Sep 17 00:00:00 2001 From: Dorota Wojcik Date: Mon, 27 Nov 2023 13:29:12 +0100 Subject: [PATCH 1/3] fix for ca.pem error --- docs/products/mysql/howto/connect-with-php.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/products/mysql/howto/connect-with-php.rst b/docs/products/mysql/howto/connect-with-php.rst index 2bea1b8ed8..97f0048506 100644 --- a/docs/products/mysql/howto/connect-with-php.rst +++ b/docs/products/mysql/howto/connect-with-php.rst @@ -18,10 +18,17 @@ Pre-requisites -------------- * :doc:`/docs/platform/howto/download-ca-cert` from `Aiven Console `__ > the **Overview** page of your service. This example assumes it is in a local file called ``ca.pem``. +* Make sure you have permissions to read/ write to the `ca.pem` file. If not, add an absolute path to the `ca.pem` file into :ref:`the code `: + + .. code-block:: bash + + $conn .= ";sslmode=verify-ca;sslrootcert='D:/absolute/path/to/ssl/certs/ca.pem .. note:: Your PHP installation needs to include the `MySQL functions `_ (most installations have this already). +.. _connect-mysql-php-code: + Code ---- From d59b75ed8bb6fd8d186bcc1288a6d6546b92a50f Mon Sep 17 00:00:00 2001 From: Dorota Wojcik Date: Mon, 27 Nov 2023 14:44:17 +0100 Subject: [PATCH 2/3] Eddy's comments --- code/products/mysql/connect.php | 2 +- docs/products/mysql/howto/connect-with-php.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/products/mysql/connect.php b/code/products/mysql/connect.php index a2497c4db0..d3746a6bf6 100644 --- a/code/products/mysql/connect.php +++ b/code/products/mysql/connect.php @@ -9,7 +9,7 @@ $conn .= "host=" . $fields["host"]; $conn .= ";port=" . $fields["port"];; $conn .= ";dbname=defaultdb"; -$conn .= ";sslmode=verify-ca;sslrootcert=ca.pem"; +$conn .= ";sslmode=verify-ca;sslrootcert='D:/absolute/path/to/ssl/certs/ca.pem"; try { $db = new PDO($conn, $fields["user"], $fields["pass"]); diff --git a/docs/products/mysql/howto/connect-with-php.rst b/docs/products/mysql/howto/connect-with-php.rst index 97f0048506..36f6ad55da 100644 --- a/docs/products/mysql/howto/connect-with-php.rst +++ b/docs/products/mysql/howto/connect-with-php.rst @@ -18,7 +18,7 @@ Pre-requisites -------------- * :doc:`/docs/platform/howto/download-ca-cert` from `Aiven Console `__ > the **Overview** page of your service. This example assumes it is in a local file called ``ca.pem``. -* Make sure you have permissions to read/ write to the `ca.pem` file. If not, add an absolute path to the `ca.pem` file into :ref:`the code `: +* Make sure you have permissions to read/ write to the `ca.pem` file and you add an absolute path to the `ca.pem` file into :ref:`the code `: .. code-block:: bash From 3900c3fda94fcf98215f9563d667d037ff3a95ec Mon Sep 17 00:00:00 2001 From: Dorota Wojcik Date: Mon, 27 Nov 2023 14:46:46 +0100 Subject: [PATCH 3/3] fix --- docs/products/mysql/howto/connect-with-php.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/products/mysql/howto/connect-with-php.rst b/docs/products/mysql/howto/connect-with-php.rst index 36f6ad55da..06c59e18cd 100644 --- a/docs/products/mysql/howto/connect-with-php.rst +++ b/docs/products/mysql/howto/connect-with-php.rst @@ -18,7 +18,7 @@ Pre-requisites -------------- * :doc:`/docs/platform/howto/download-ca-cert` from `Aiven Console `__ > the **Overview** page of your service. This example assumes it is in a local file called ``ca.pem``. -* Make sure you have permissions to read/ write to the `ca.pem` file and you add an absolute path to the `ca.pem` file into :ref:`the code `: +* Make sure you have read/write permissions to the `ca.pem` file and you add an absolute path to this file into :ref:`the code `: .. code-block:: bash