Home:ALL Converter>Connecting Google Cloud SQL with Wordpress on Google Compute Engine

Connecting Google Cloud SQL with Wordpress on Google Compute Engine

Ask Time:2014-02-27T13:31:15         Author:Lawrence Taur

Json Formatter

I've been running a successful Wordpress install on Google Compute Engine with Nginx, Php-fpm and Mysql.

I noticed you can also run Wordpress on App Engine with a Cloud SQL connection as mentioned here https://developers.google.com/appengine/articles/wordpress?hl=en

I want to use Wordpress on Compute Engine with the db running on Cloud SQL.

On AppEngine, you need to put the following lines in the wp-config.php file

if(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App      Engine') !== false) {
  define('DB_HOST', ':/cloudsql/YOUR_PROJECT_ID:wordpress_db_name');F
}else{
  define('DB_HOST', 'localhost');
}

Is there a similar way to connect Wordpress on Compute Engine with Cloud SQL?

Author:Lawrence Taur,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22059821/connecting-google-cloud-sql-with-wordpress-on-google-compute-engine
yy