WordPress.org

Ready to get started?Download WordPress

Forums

502 Bad Gateway - installing via Plesk (9 posts)

  1. lbartlett
    Member
    Posted 6 years ago #

    I am trying to install WordPress on a site using a Windows server with Plesk. I have uploaded and unzipped the files, created the MySQL database and edited wp-config.php

    When going to wp-admin/install.php, I get the following error:

    502 Bad Gateway
    Web server received an invalid response while acting as a gateway or proxy server.

    Googling, I discover this may occur under Plesk when a fopen() is attempted on a file not in the local filesystem.

    By the process of commenting out various lines in the source, I am 99% sure it is happening somewhere in wp-settings.php

    However, this file contains a large amount of requires() and before I spend too much time trying to find out where the culprit is, I thought I would ask here if anyone has had the same problem or would know where the rogue fopen() might be. As far as I can tell, it won't be possible for me to change the PHP configuration to fix it, so hopefully it is something that can be worked around.

  2. mysticeye
    Member
    Posted 6 years ago #

    I know this doesn't really solve your problem, but I was having the same issue installing under Plesk. I went back and found the version I had been using previously and it works fine. It looks like its version 2.0.4

    That should at least get you up and running then one day we can update *lol*

  3. ScruffyTeg
    Member
    Posted 6 years ago #

    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

  4. chitown
    Member
    Posted 6 years ago #

    this issue was solved for me by:
    1. logging into plesk
    2. going to domainname.com > Setup
    3. look down by Services - PHP Support
    4. make sure "run as ISAPI extension" is checked (mine was not)

    2.3.2 installed perfectly.

  5. ScruffyTeg
    Member
    Posted 6 years ago #

    Unfortunately the only PHP settings I have with my host (Plesk 8.1.1) is choosing the PHP version (4.4.3 or 5.2.0).
    phpinfo() says "Server API: CGI/FastCGI".

    But, adding isapi to my google search terms bought up this gem:

    http://forums.crystaltech.com/index.php/topic,32891.0.html

  6. mikeboas
    Member
    Posted 6 years ago #

    In my version of Plesk, I don't have "Settings," Services," or "PHP Support." So I can't make those changes!

  7. mikeboas
    Member
    Posted 6 years ago #

    Okay, I followed the other piece of advice here and installed version 2.0.4

    So far so good.

  8. webcyber
    Member
    Posted 6 years ago #

    Yes, 'chitown' is right, I tried his method with my plesk 8.2.2 control panel.

    this issue was solved for me by:
    1. logging into plesk
    2. going to domainname.com > Setup
    3. look down by Services - PHP Support
    4. make sure "run as ISAPI extension" is checked (mine was not)

    2.3.3 installed perfectly.

  9. edub9
    Member
    Posted 6 years ago #

    I had the same issue but now I am getting this error.
    But only from the back end.

    Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\sleepspecialists.org\httpdocs\edub9blog\wp-config.php:47) in C:\Inetpub\vhosts\sleepspecialists.org\httpdocs\edub9blog\wp-login.php on line 12

    Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\sleepspecialists.org\httpdocs\edub9blog\wp-config.php:47) in C:\Inetpub\vhosts\sleepspecialists.org\httpdocs\edub9blog\wp-login.php on line 24

Topic Closed

This topic has been closed to new replies.

About this Topic