开发者

Wordpress ==> SSL ==> MySQL is this configuration possible?

I am trying to put SSL encryption between my Wordpress application and its MySQL database, is anyone aware of a solution/tutorial for this? Hav开发者_运维问答en't managed to find anything on Google or the Wordpress codex.


Further to @ticoombs response, and after some digging / testing, I found that by changing the constant defined in wp-config.php (in the root directory) to the following it worked!

define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);

...note the extra "I" in MYSQLI_CLIENT_SSl.

Symptoms: The symptom I observed was that the call to mysql_connect in /wp-includes/wp-db.php was generating a warning that parameter 8 (i.e. $client_flags) was not an integer.

Version: Vanilla install of 4.8.1, running on php 7.0


Yes. It is possible to connect Wordpress to mysql using SSL. Add define('DB_SSL', true); to your wp-config.php file and take a look at this:

http://wordpress.org/support/topic/wordpress-with-mysql-over-ssl


Just to build on the answer:

File Location: /wordpress/wp-includes/wp-db.php

From:

$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;

To:

$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : MYSQL_CLIENT_SSL;

Currently WP should be able to handle adding, (below) to the wp-config.php. (But in my findings i have not been able to get it to work.

define('MYSQL_CLIENT_FLAGS', MYSQL_CLIENT_SSl);

I wrote a good blog post on the matter. Source

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜