Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Themes

Discuss SilverStripe Themes.

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

Installation Woahs...


Reply

4 Posts   2260 Views

Avatar
VTJohnson

1 August 2009 at 7:07am Community Member, 5 Posts

Hey all,

So I know this sort of thing has been posted before but from what I can tell I have a pretty unique issue.

I recently installed SilverStripe on XP and got the main CMS up and running, however I have not yet been able to get a single module work, theme or otherwise.

So here is what happens, I:

- Download the tar.gz and unpack it using 7zip into the themes folder.
- I then go into the mysite folder and open up the config file in notepad
- I change the SSViewer::set_theme('themename'); line.
- I visit my site and attmept to use the ?flush=1 line in a number of different places. (my site is located at http://localhost/silverstripe/ and no matter where I put the ?flush=1 piece i get the following error. I have checked the theme directory and turned off the read-only setting in case it was part of the permission issue.

[Warning] file_get_contents(c:\inetpub\wwwroot\silverstripe/themes/higherground/templates/Page.ss) [function.file-get-contents]: failed to open stream: Permission denied
GET /silverstripe/index.php?flush=1

Line 320 in C:\Inetpub\wwwroot\silverstripe\sapphire\core\SSViewer.php
Source

311       
312       if(isset($_GET['debug_profile'])) Profiler::mark("SSViewer::process", " for $template");
313       $cacheFile = TEMP_FOLDER . "/.cache" . str_replace(array('\\','/',':'),'.',realpath($template));
314
315       $lastEdited = filemtime($template);
316
317       if(!file_exists($cacheFile) || filemtime($cacheFile) < $lastEdited || isset($_GET['flush'])) {
318          if(isset($_GET['debug_profile'])) Profiler::mark("SSViewer::process - compile", " for $template");
319          
320          $content = file_get_contents($template);
321          $content = SSViewer::parseTemplateContent($content, $template);
322          
323          $fh = fopen($cacheFile,'w');
324          fwrite($fh, $content);
325          fclose($fh);

I experience similar issues with modules as well. I cant seem to get the /dev/build?flush=1 to work. I'm not even sure I putting it in the right spot.

Any help would be greatly appreciated.

Avatar
Willr

1 August 2009 at 9:03pm Forum Moderator, 5511 Posts

file_get_contents(c:\inetpub\wwwroot\silverstripe/themes/higherground/templates/Page.ss) [function.file-get-contents]: failed to open stream: Permission denied

One odd thing is the url - it uses \ as well as /. That could be affecting something.

Does that apache user (or www-data) have the correct permissions for reading the file (try but setting to chmod 777 the template file, reload to see if that fixes it, then work backwards as you shouldn't need it 777).

Avatar
VTJohnson

5 August 2009 at 7:58am Community Member, 5 Posts

Okay so I tried yet another theme and I continue to get errors. My most recent attempt involved the following Livis theme which is attached. I have compared both the Livis directory and the blackcandy directory and see no differences really, why wont these work!?!

Here is the error I am getting:

[Warning] None of these templates can be found: Page.ss, ContentController.ss
GET /silverstripe/index.php

Line 175 in C:\Inetpub\wwwroot\silverstripe\sapphire\core\SSViewer.php
Source

166                $this->chosenTemplates['main'] = $this->chosenTemplates[$templateFolder];
167                unset($this->chosenTemplates[$templateFolder]);
168             }
169          }
170
171          if(isset($_GET['debug_request'])) Debug::message("Final template selections made: " . var_export($this->chosenTemplates, true));
172
173       }
174
175       if(!$this->chosenTemplates) user_error("None of these templates can be found: ". implode(".ss, ", $templateList) . ".ss", E_USER_WARNING);
176
177       parent::__construct();
178    }
179    
180    /**
181     * Returns true if at least one of the listed templates exists

Trace

* None of these templates can be found: Page.ss, ContentController.ss
Line 175 of SSViewer.php
* SSViewer->__construct(Array)
Line 308 of Controller.php
* Controller->getViewer(index)
Line 175 of Controller.php
* Controller->handleAction(HTTPRequest)
Line 129 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 29 of ModelAsController.php
* ModelAsController->handleRequest(HTTPRequest)
Line 44 of RootURLController.php
* RootURLController->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct()
Line 118 of main.php
* require_once(C:\Inetpub\wwwroot\silverstripe\sapphire\main.php)
Line 71 of index.php

Any help would be great. I am so confused. Is it a naming thing. I know you are supposed to put the name in the SSViewer line but is that just the name of the directory or could it be wanting something else?

Attached Files
Avatar
VTJohnson

6 August 2009 at 8:46am Community Member, 5 Posts

Okay, an update...

I was able to install the Blog module and have finally figured out the correct way to use /db/build?flush=1 but I am still having trouble with Themes. I attempted once again to install and activate the same theme as above, but am getting a different error now. It is as follows, and is the same as the error code shown at the top of this post.

[Warning] file_get_contents(c:\inetpub\wwwroot\silverstripe/themes/livis/templates/Page.ss) [function.file-get-contents]: failed to open stream: Permission denied
GET /silverstripe/index.php/

Line 320 in C:\Inetpub\wwwroot\silverstripe\sapphire\core\SSViewer.php
Source

311       
312       if(isset($_GET['debug_profile'])) Profiler::mark("SSViewer::process", " for $template");
313       $cacheFile = TEMP_FOLDER . "/.cache" . str_replace(array('\\','/',':'),'.',realpath($template));
314
315       $lastEdited = filemtime($template);
316
317       if(!file_exists($cacheFile) || filemtime($cacheFile) < $lastEdited || isset($_GET['flush'])) {
318          if(isset($_GET['debug_profile'])) Profiler::mark("SSViewer::process - compile", " for $template");
319          
320          $content = file_get_contents($template);
321          $content = SSViewer::parseTemplateContent($content, $template);
322          
323          $fh = fopen($cacheFile,'w');
324          fwrite($fh, $content);
325          fclose($fh);
326

Trace

* file_get_contents(c:\inetpub\wwwroot\silverstripe/themes/livis/templates/Page.ss)
Line 320 of SSViewer.php
* SSViewer->process(Page_Controller)
Line 175 of Controller.php
* Controller->handleAction(HTTPRequest)
Line 129 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 29 of ModelAsController.php
* ModelAsController->handleRequest(HTTPRequest)
Line 44 of RootURLController.php
* RootURLController->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct()
Line 118 of main.php
* require_once(C:\Inetpub\wwwroot\silverstripe\sapphire\main.php)
Line 71 of index.php

I have the CMS installed on a Windows XP Machine running IIS, MySQL, and PHP 5. I have a feeling it is just a permissions issue but I have no idea how to "777" or "766" a directory in windows as I do I Linux. Anyone have any ideas to attempt to resolve this issue?