Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » HTTPS mode and IIS

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2 3
Go to End
Author Topic: 134846 Views
  • gshegosh
    Avatar
    Community Member
    6 Posts

    Re: HTTPS mode and IIS Link to this post

    Following are hacks I needed to add so i18n works on IIS. IIS soooo sucks, but what can I do when my customer uses it. This method is in sapphire/core/i18n.php file:

       protected static function get_owner_module($name) {
          if (substr($name,-3) == '.ss') {
             global $_TEMPLATE_MANIFEST;
             $path = current($_TEMPLATE_MANIFEST[substr($name,0,-3)]);

             // hacks for IIS -->
             $path = str_replace('\\sapphire/..', '', $path);
             $path = str_replace('C:', '', $path);
             $path = str_replace('\\', '/', $path);
             $bf = Director::baseFolder();
             $bf = str_replace('C:', '', $bf);
             $bf = str_replace('\\', '/', $bf);
             // <--

             ereg($bf . '/([^/]+)/',$path,$module);
          } else {
             global $_CLASS_MANIFEST;
             $path = $_CLASS_MANIFEST[$name];

             // hacks for IIS -->
             $path = str_replace('\\sapphire/..', '', $path);
             $path = str_replace('C:', '', $path);
             $path = str_replace('\\', '/', $path);
             $bf = Director::baseFolder();
             $bf = str_replace('C:', '', $bf);
             $bf = str_replace('\\', '/', $bf);
             // <--

             ereg($bf . '/([^/]+)/',$path,$module);
          }
          return $module[1];

       }

    I've written it in multiple lines so it's obvious what the fix does.

  • gshegosh
    Avatar
    Community Member
    6 Posts

    Re: HTTPS mode and IIS Link to this post

    I18n still won't work with PHP 5.1.2 on IIS. I've asked the ISP to upgrade PHP version since there is a _specific_ hack for 5.1.2 in Object.php that seems to fail.

    Perhaps someone can point me in the right direction with it.

    It seems that even though SiteTree has static $db member, the Object->uninherited method goes on and tries to get $db from SiteTree's parent class which doesn't seem to have it. When I patched the Object.php so it gets SiteTree's $db directly, it seemed to work for a little while: I could add a translation to my page, but it never showed up on live system (both language versions where always the same no matter which one I edited).

    So the question is - does it have to do with the need to take $db from parent class instead of SiteTree or is it another bug with IIS?

    I will come back to You if I get PHP upgraded, but that might never happen If anyone in the meantime can help me out, I will surely return the knowledge to the community - I will have to get SilverStripe fully going on IIS so when I'm finished, IIS can be added to supported servers list I guess. I will also improve Polish translation since it's incomplete.

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: HTTPS mode and IIS Link to this post

    This has been fixed on the subversion trunk - you can see it here http://open.silverstripe.com/changeset/46821

    You should be able to patch your version with this changeset.

  • gingercat
    Avatar
    Community Member
    7 Posts

    Re: HTTPS mode and IIS Link to this post

    Just downloaded SS and trying to install on IIS. Can someone give me detailed instructions.

    the install script is reporting the environment is ok (MySql and PHP) working fine but the problem is probably the whole mod-rewrite thing. How do I implement this on IIS?

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: HTTPS mode and IIS Link to this post

    You will need a 3rd party tool ISAPI Rewrite - see here for more information: http://doc.silverstripe.com/doku.php?id=iis-installation

    Our IIS documentation is really lacking and we would appreciate it if members of the community could provide some more step-by-step instructions for that wiki page!

  • mackeyn
    Avatar
    Community Member
    1 Post

    Re: HTTPS mode and IIS Link to this post

    I just setup SilverStripe 2.2.2 with IIS6 and ran into three issues. Two of which that were mentioned in this thread:

    $_SERVER['https'] issue
    Loading of i18n files

    And a third one dealing with $_GET['url']:
    $_GET['url']

    I submitted tickets with patches. I hope this helps any of you out there that need to get SilverStripe up and running on IIS.

  • gshegosh
    Avatar
    Community Member
    6 Posts

    Re: HTTPS mode and IIS Link to this post

    I've put a step by step instructions together, feel free to copy it to SilverStripe wiki

    http://acogitosis.krop.pl/2008-07-03-en-installing-silverstripe-on-iis-server/

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: HTTPS mode and IIS Link to this post

    Hey guys, it's awesome that you've figured out the IIS stuff.

    You do realise that doc.silverstripe.com is a wiki.... so I have updated

    http://doc.silverstripe.com/doku.php?id=iis-installation

    And linked to it, making notes that people taking this approach need to be careful .

    That way more people will see the information you've created. Over time the page will become simpler as the bugs relating to IIS get fixed and therefore don't need manual hacking

    134846 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.