0
Welcome Guest! Login
0 items Join Now

Error after migrating site to IIS7

  • Error after migrating site to IIS7

    Posted 4 months 5 days ago
    • I've encountered an unexpected error after backing up my site from Ionis and restorting it to a dev IIS box. I believe I have all the pre-requisits set up right on the IIS box and I used Akeeba to backup and restore the site without error. This is the error I get when trying to open the site:

      PHP Warning: count(): Parameter must be an array or an object that implements Countable in <local folder path to site>\plugins\system\gantry\gantry.php on line 406

      The adminsistrator console loads fine and I can log in and admin the backend just fine.

      Any suggestion on a solution to this issue? Smells like I may have some sort of PHP config element set incorrectly on the IIS box.

      Thanks
    • Last Edit: 4 months 23 hours ago by David Wolfe.
  • Re: Error after migrating site to IIS7

    Posted 4 months 5 days ago
    • Probably should mention that the only difference in the two environments (Ionis vs. local IIS box) is the mySQL version. Ionis is a 5.x and I have an 8.x mySQL DB installed on the Windows server. Otherwise, the PHP versions are the same on both environments, 7.4.33

      The 406 line in the gantry.php file is:
      [line 406] if (($this->_contains($buffer, $this->bootstrapTriggers) || count($messages)) && version_compare(JVERSION, '3.0.0') >= 0) {
      	JHtml::_('bootstrap.framework');
      }

      $messages var is being set earlier by:
      $messages = JFactory::getSession()->get('application.queue');
    • Last Edit: 4 months 5 days ago by David Wolfe.
  • Re: Error after migrating site to IIS7

    Posted 4 months 22 hours ago
    • I've found I could fool the code into a working state by defining a fake a $messages array of:

      $messages = array("one","two","three");

      That lets the site load in the browser and as far as I can tell it looks to be 100% as expected. Now, I'm no PHP developer so I don't know the full ramifications of what I've just changed. Can anyone comment on this change and if it would compromise the site security should I expose it to the Internet?

      Quick follow up....

      It seems I can also get the site to function normally by setting the existing $messages value into an array as well:

      $messages = array(JFactory::getSession()->get('application.queue'));

      That makes me feel a little bit better about the change but I still have no idea if it's a viable change for public use of the site.
    • Last Edit: 4 months 22 hours ago by David Wolfe.
    • The following users have thanked you: Matt

Time to create page: 0.065 seconds