We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22595
    • 10 Posts
    Hello grin

    I designed a new site for a client of mine and chose modx as the most powerful and simple to implement cms I’ve used so far.

    Everything worked fine and as I’ve tried it out on both unix and windows hosting it seemed like it would work fine under any environment.

    Unfortunately my client is using hosting services from one of the major players in my country and they only provide IIS hosting with Plesk CP.

    After setting up modx-2.0.4-pl2 (traditional) succesfully, I tried to login to the manager. Page opened up just fine, gave the correct user/pass and got the following message.

    The page cannot be displayed
    The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

    Please try the following:
    Contact the Web site administrator if you believe that this request should be allowed.
    Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
    HTTP Error 405 - The HTTP verb used to access this page is not allowed.
    Internet Information Services (IIS)

    Technical Information (for support personnel)
    Go to Microsoft Product Support Services and perform a title search for the words HTTP and 405.
    Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Setting Application Mappings, Securing Your Site with Web Site Permissions, and About Custom Error Messages.

    Seems like there’s something amiss in their rights setup? I’m not familiar with Plesk and I’d like some help on where to go and what to change to make it work. Checking Plesk I saw that the latest PHP and MySQL builds are installed.

    Thank you very much smiley
      • 22595
      • 10 Posts
      To help a bit more, I traced the problem to /manager/templates/default/security/login.tpl in
      <form id="modx-login-form" action="" method="post">

      Seems like the server doesn’t like the post method. If anyone can tell me how to fix this through Plesk, I’ll be really grateful since I’m getting no help from the ISP. :’(
        • 22595
        • 10 Posts
        More on that, it seems that it is actually a modx-2.0.4-pl2 bug so it would be great if an admin could look into it.

        The web hosting service contacted me and told me that there is an option of installing modx 2.0.0 through their Plesk panel and it worked fine so POST was propely set up on their behalf.

        In the meantime I had already setup the latest modx on my windows 7 through xampp, had the hosts file changed so that the live site url redirected to 127.0.0.1, thus typing the site’s address showed me the site running on xampp and I logged in as administrator to fix the site structure while waiting for support to call me or someone to reply here.

        Afterwards I removed the hosts entry, copied the files and database to the web hosting company’s server, fixed the paths in all the config.core.php and the site was working just fine, going into the manager I logged in directly since my browser had the cookie from my previous login in the local server and I could even change a couple files.

        I logged out and tried to log back in, only to get the dreadful 405 error again. I’m positive now that something has changed in the logging process from 2.0.0 to 2.0.4-pl2. Has anyone got any ideas on what it might be?

        Please, it would be great if some developer looked into it and gave me a quick solution, I tried to be as detailed as possible.
          • 22595
          • 10 Posts
          And even more info hoping that I’ll eventually get some answer. grin

          Using ExamDiff I compared various files involved in the login process between 2.0.0 and 2.0.4 versions.

          I found the following changes in manager/controllers/default/security/login.php

          from 2.0.0
          $modx->smarty->assign('modahsh',$_REQUEST['modahsh']);

          to 2.0.4
          $hash = $modx->sanitizeString($_REQUEST['modahsh']);
          $modx->smarty->assign('modahsh',$hash);


          from 2.0.0
          $modx->smarty->assign('returnUrl',$_SERVER['REQUEST_URI']);

          to 2.0.4
          $chars = array("'",'"','(',')',';','>','<','!');
          $returnUrl = str_replace($chars,'',$_SERVER['REQUEST_URI']);
          $modx->smarty->assign('returnUrl',$returnUrl);


          from 2.0.0
           } else {
          $modx->smarty->assign('error_message',$modx->lexicon('login_cannot_locate_account'));
          $validated = false;

          to 2.0.4
          *REMOVED*

          from 2.0.0
          $url = !empty($_POST['returnUrl']) ? $_POST['returnUrl'] : $modx->getOption('manager_url');
          $modx->sendRedirect($url,'','','full');

          to 2.0.4
          $url = !empty($_POST['returnUrl']) ? $_POST['returnUrl'] : $modx->getOption('manager_url',null,MODX_MANAGER_PATH);
          $modx->sendRedirect(rtrim($url,'/'),'','','full');


          I tried replacing 2.0.4 login.php with the 2.0.0 version just in case it worked and I got "Recursion too deep; the stack overflowed."

          Running out of ideas on this little bug... huh
            • 22595
            • 10 Posts
            Guess noone can help me with it... Will try older versions hoping that the current database will play ok with them. Will report if I find anything new.
              • 17897
              • 46 Posts
              I think the big thing is that no one knows Plesk (myself included). It still sounds like something is not right in your PHP configuration, perhaps you need to manually make sure all verbs are allowed for all folders in your site? I know with IIS this is set at the root level and propagates down, perhaps something is off on your site such that it isn’t? I’m really shooting in the dark mind you, but make sure PHP verbs are allowed throughout the whole site (not sure how this works on Plesk, sorry).
                • 22595
                • 10 Posts
                Plesk is widely used unfortunately is lots of "big" hosting companies and I’m not familiar with it either since I don’t really like it.

                But unfortunately that’s all I can work with. I tried 2.0.0, got recurring error like the one described above... 2.0.2 same, 2.0.4 again and 405.

                Now I make the changes to the local server and export/import the SQL tables accordingly since login won’t work.

                Is there any way to cripple the whole login process? Like change or remove a part of the code and upon entering /manager/ going directly into the control panel without the login process.

                Security is no issue, I can just rename a .php file needed and let their IT know to name it back when he wants to do changes on their own... Temporary solution until I or someone else comes up with a solution.

                If any developer wants me to help out so that modx runs properly with Plesk as well, I’m willing to help in any way, anything to contribute to this great piece of software.
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Without more details of the environment, it’s going to be difficult to diagnose this. But it definitely sounds like the PHP/IIS configuration is the problem; it is not a problem with the login process.
                    • 22595
                    • 10 Posts
                    Well, if it helps they’re using Parallel Plesk 9.2, PHP 5.2.6, MySQL 5.0.45, IIS 6 on Windows Server 2008 R2.

                    Since I’m only getting an error in the login process and the rest of the site works fine, there has to be something in it that causes the problem. Even if it is server-wise, what should I tell their support to look for that could be giving the 405 error?
                      • 17897
                      • 46 Posts
                      I had a similar problem today with my MODx install (405 on login), eventually it was traced to a PHP configuration that just didn’t like running as plain CGI. A reinstallation under fastCGI cured the issue for me, you might be having a similar problem. Probably not something you can fix though, but ask your provider anyway?