I’ve just hit this with ASP.NET/IIS hosting. A google search turns up this unresolved thread! So, I started tracing it down…
Basically during install, wordpress queries the db. This errors (because no tables have yet been created).
The function print_error($str = ”) is then called to log the legitimate error, which in turn calls error_log(). This is the point where IIS decides it will log the error by spewing out 502 Bad Gateway.
I imagine PHP/IIS can be configured to be slightly less melodramatic, but I’m no PHP expert so I just commented out the call to error_log in wp-db.php print_error function as below:.
function print_error($str = '') {
global $EZSQL_ERROR;
if (!$str) $str = mysql_error($this->dbh);
$EZSQL_ERROR[] =
array ('query' => $this->last_query, 'error_str' => $str);
$error_str = "WordPress database error $str for query $this->last_query";
// Comment out error_log to workround 502 Bad Gateway reporting
// error_log($error_str, 0);
Hope that helps. If anyone knows how to make error_log behave on vitual hosting of IIS/PHP5 I’d love to hear…
— Rich