Jump to:

4938 Posts in 16602 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Issue when accessing index.php for first time?

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 1407 Views
  • supermegaultra
    Avatar
    Community Member
    33 Posts

    Issue when accessing index.php for first time? Link to this post

    Hi all,

    I've just installed SS for the first time and am sure I have done everything correct. I'm having trouble getting silverstripe/index.php to display properly from my computer, in the browser. It shows the following instead of the console:

    "$snLen && substr($_SERVER['REQUEST_URI'],0,$snLen+1) == ($_SERVER['SCRIPT_NAME'] . '/')) { $url = substr($_SERVER['REQUEST_URI'],$snLen+1); $url = strtok($url, '?'); } else { $url = $_SERVER['REQUEST_URI']; if($url[0] == '/') $url = substr($url,1); $url = strtok($url, '?'); } // Apache will populate the server variables this way } else { if($ruLen > $snLen && substr($_SERVER['REQUEST_URI'],0,$snLen+1) == ($_SERVER['SCRIPT_NAME'] . '/')) { $url = substr($_SERVER['REQUEST_URI'],$snLen+1); $url = strtok($url, '?'); } else { $url = ""; } } $_GET['url'] = $_REQUEST['url'] = $url; $fileName = dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $url; /** * This code is a very simple wrapper for sending files * Very quickly pass through references to files */ if($url && file_exists($fileName)) { $fileURL = dirname($_SERVER['SCRIPT_NAME']) . '/' . $url; header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); header("Location: $fileURL"); die(); } // For linux $_SERVER['SCRIPT_FILENAME'] = str_replace('/index.php','/sapphire/main.php', $_SERVER['SCRIPT_FILENAME']); $_SERVER['SCRIPT_NAME'] = str_replace('/index.php','/sapphire/main.php', $_SERVER['SCRIPT_NAME']); // And for windows $_SERVER['SCRIPT_FILENAME'] = str_replace('\\index.php','\\sapphire\\main.php', $_SERVER['SCRIPT_FILENAME']); $_SERVER['SCRIPT_NAME'] = str_replace('\\index.php','\\sapphire\\main.php', $_SERVER['SCRIPT_NAME']); chdir('sapphire'); require_once('sapphire/main.php'); "

    Anyone else have this problem? Looking forward to your reply. Cheers!

  • supermegaultra
    Avatar
    Community Member
    33 Posts

    Re: Issue when accessing index.php for first time? Link to this post

    I think I'm having a problem with PHP not wanting to run locally. PHP is not showing up in my IIS manager. Would anyone know how to make this so?

    Cheers.

    1407 Views
Page: 1
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.