Jump to:

23355 Posts in 17873 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Moved site from subfolder to root - getting blank pages

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 2295 Views
  • lawless
    Avatar
    Community Member
    33 Posts

    Moved site from subfolder to root - getting blank pages Link to this post

    Hi, I managed to get Silverstripe up and running and get the blog module and dataObjectmanager working in a subfolder named "/dev" on a live site. No problems there. Got it ready to push live and everything was working great, and I did some digging on the forum and read multiple threads about just updated the .htaccess file after the move from the /dev folder to /.

    After I moved all the files out of the /dev folder and into the root directory, all I get is a blank page. I didn't change any of the files except the .htaccess to point to / instead of /dev.

    Can anyone offer any insight on how to start troubleshooting this?

    I read about ?debug last night, I'm going to dig into that a bit more, but it's hard to diagnose because all I get is a blank page. No errors, no info.

    Thanks for any insight offered on this.

    Something worth noting, the root directory has a /web/ folder where the files live and there is an /images and /errors folders in there from the current live "under construction" page. Would Silverstripe have a problem with other folders being in it's main directory structure?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Moved site from subfolder to root - getting blank pages Link to this post

    The first thing I do whenever I get a blank page is having a look at the PHP error log. It usually means there's some sort of PHP error occurring.

  • lawless
    Avatar
    Community Member
    33 Posts

    Re: Moved site from subfolder to root - getting blank pages Link to this post

    Unfortunately, I don't have access to the PHP logs.

    I did get the install.php page to work and it's giving me all kinds of error warnings, mostly related to permissions. I don't want to re-install, I figured it would be a good way to see what's going on though. It seems the "root" user own the files and Silverstripe wants "apache" to own them. Can I change the ownership somehow?

    Here's some of the errors from the install.php page:

    File permissions
    Does the webserver know where files are stored?   The webserver isn't letting me identify where files are stored. (file '/sapphire/dev/install/config-form.html' not found)

    mysite/ folder exists    There's no mysite folder. (file '/mysite' not found)

    Is the .htaccess file writeable?   User 'apache' needs to be able to write to this file:
    /.htaccess

    The file is currently owned by 'root'. There is no user-group that contains both the web-server user and the owner of this file. Change the ownership of the file, create a new group, or temporarily make the file writeable by everyone during the install process.

    Is the mysite/_config.php file writeable?   User 'apache' needs to be able to write to this file:
    /mysite/_config.php

    The file is currently owned by 'root'. There is no user-group that contains both the web-server user and the owner of this file. Change the ownership of the file, create a new group, or temporarily make the file writeable by everyone during the install process.

    etc...

    All the folders are there, I just moved them to the root directory from a subdirectory, where everything was working perfectly, which leads me in the direction of permission problems. I didn't change any files, just moved them. All my files are owned by my FTP user now. I wonder if it's a combination of .htaccess and a permission problem?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Moved site from subfolder to root - getting blank pages Link to this post

    Hi

    After SilverStripe has been installed, it doesn't need to write _config.php nor the .htaccess file. You should be fine by changing permissions on the asset folder to 777 (recursively).
    I suggest, you add the following to your _config.php:

    Debug::send_errors_to('yourEmail');


    Where yourEmail should be a mail address to send the php errors to. That way you should get some error information without the need of a php error log.

    Btw. What exactly did you change in the .htaccess?

  • lawless
    Avatar
    Community Member
    33 Posts

    Re: Moved site from subfolder to root - getting blank pages Link to this post

    Hey Banal, thanks for the replies. I tried adding the Debug::send_errors_to('yourEmail'); but no luck there either. I don't think it ever got a chance to error out, it just wasn't finding the files. I also tried putting it into DEV mode to get error reporting but never got anything from that either. I tried a bunch of the URL debugging with no success as well.

    I updated the .htaccess file originally, to change RewriteBase /dev to RewriteBase /

    I ended up deleting EVERYTHING, totally emptying the root directory, and re-uploading my UnderConstruction page and image files, then re-installed Silverstripe into a subdirectory from my good build on my local machine. I just changed the .htaccess and mysite/_config files and did a dev/build?flush=1 and everything came back up. I never deleted the Production database, so all that was still there.

    I still never figured out what the problem was, so I'm going to try to put a .htaccess file in the root directory to forward any traffic to my working subfolder site.

    I even tried a clean install from a fresh download of 2.3.2 in the root and still got the same problems, so I suspect there it something going on with the shared hosting, but can't pinpoint what.

  • lawless
    Avatar
    Community Member
    33 Posts

    Re: Moved site from subfolder to root - getting blank pages Link to this post

    Well, I got my SilverStripe site working by just typing in the domain name now.

    I added an .htaccess page to my root directory that looks like this:

    ###########

    RewriteEngine On
    RewriteBase /
    RewriteRule ^$ /ifonly

    ###########

    Here's the link where I got that example from:
    http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteBase

    Essentially what that does is makes my www.mydomain.com/silverstripe load when you type in www.mydomain.com

    The URL path looks like this www.mydomain.com/silverstripe/?url=/silverstripe once it's redirected, but that's a lot better than a blank page.

    I can probably tweak the .htaccess file in the /silverstripe directory to strip out the directory name, but I've pulled enough of my hair out trying to get this all up and running.

    Funny quote from the Apache.org site while reading about mod_rewrite:

    `` Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. ''
    -- Brian Moore
    bem@news.cmc.net

    2295 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.