Saturday, 15 March 2014

php - Setup SSL for PDO-MySQL on Fedora -


I want to set up SSL for MySQL on Fedora. I am using PDO in PHP as a MySQL-connector. But it is not working.

PHP-version (php -v) is:

PHP 5.6.6 (CLI) (created: February 19, 2015 13:46: 39)

When I check for php -m , I get a long list, which openssl, PDO, pdo_mysql, mysql. In

I have added "SSL" and three certificates (CA-Root, Private Key, Certificate) in / code / my.cnf . I restart MySQL and Apache.

The PDO-connector is:

  function getDBConn () {new PDF back ('mysql: host = localhost; dbname = forum', user, pass, array ( PDO :: MYSQL_ATEM_SSL_KEY = & gt; Path_to_sme_s_in_mn.fkk, PDO :: MySQL_ATTR_SSL_CERT = & gt; Path_to_sm_a_s_in_man.cn CRT, PDO :: MYSQL_ATTR_SSL_CA = & gt; Path_to_sem_e_s_a_i_man.cng.}}  

But on the pages connecting to the database, I get the following errors:

  Warning: PDO :: __ generation (): This section uses SSL / crypto 78/78 / XP / HTML / functions.php does not support 78 Warning: PDO :: __ Construct (): Can not connect using SSL using SSL. 78 WARNING: PDO :: __ generation ( ): [2002] (Trying to connect via UNIX: ///var/lib/mysql/mysql.sock) In the line /var/www/html/functions.php 78 incorrect error: the message With regard to the exceptions 'PDOException' 'SQL: STATE [HY000] [2002]' in / var / wWw / html / functions.php: 78 stack trace .....  

Is there any solution for this too?

   

Another major reason you're getting the error is because you do not have openssl installed


No comments:

Post a Comment