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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

mod_rewrite / SSViewer error...


Go to End


8 Posts   7003 Views

Avatar
TCJeter

Community Member, 17 Posts

2 May 2007 at 9:21am

All,

My installation fails at the following point...

I get an error telling me to make sure that...

* mod_rewrite is enabled in your httpd.conf
* AllowOverride is enabled for the current path.

My host does state in their support that 'mod_rewrite' is supported, and that it is already enabled for all accounts. If I force continue at this point it says that it is successful, but then tries to redirect to...

http://XX.XX.XX.XX/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/~username/home/successfullyinstalled

(waaay too many directories there!)

Since I'm operating on a shared IP environment until the site is built and the domain transfered, will this even work?

Also, the PHP error log stated this:

PHP Warning: None of these templates can be found: ErrorPage.ss, Page.ss, ContentController.ss in /home/username/public_html/sapphire/core/SSViewer.php on line 53

Any help appreciated,
-TC

Avatar
TCJeter

Community Member, 17 Posts

2 May 2007 at 1:53pm

Andy,

Thanks for the response. I did actually try the alternate method, even with a few variations. For example I have tried the following...

(with a preceding slash)
RewriteRule .* /www/sapphire/main.php?url=%1&%{QUERY_STRING} [L]

(without a preceding slash)
RewriteRule .* www/sapphire/main.php?url=%1&%{QUERY_STRING} [L]

(with everything after the direct IP and preceding slash)
RewriteRule .* /~username/www/sapphire/main.php?url=%1&%{QUERY_STRING} [L]

(with everything after the direct IP and without the preceding slash)
RewriteRule .* ~username/www/sapphire/main.php?url=%1&%{QUERY_STRING} [L]

So I'm clueless at this point. The host does use a folder called 'public_html' for the root, but there is also a 'www' as a shortcut to the root. If you upload a file to one, it is mirrored in the other. Is there any SS configuration that is specific to the 'www' other than the .htaccess?

Thanks,
-TC

Avatar
TCJeter

Community Member, 17 Posts

4 May 2007 at 5:11am

Andy,

Thanks for the update - I will get the latest build and have another go.

Thanks,
-TC

Avatar
TCJeter

Community Member, 17 Posts

4 May 2007 at 3:02pm

Andy,

I did grab the latest build and put it to the server, but now there is a new error - I believe this may be a syntax error...

Fatal error: Call to undefined function delete() in /home/mcaonlin/public_html/rewritetest.php on line 40

If I wrap the 'delete' function line like this below, it gets past that error but still gives me the same results as before.

FROM: (line 39)

if(file_exists('.htaccess')) {
delete('.htaccess');
}

TO:

if(file_exists('.htaccess')) {
function delete() {
delete('.htaccess');
}
}

I'm not even sure that my edit is syntactically correct, though. Any help would be appreciated.

Cheers,
-TC

Avatar
TCJeter

Community Member, 17 Posts

7 May 2007 at 10:23am

Edited: 07/05/2007 10:23am

Would it be possible for someone to look into this error? I have just completed downloading the latest daily build (silverstripe.2.0.DailyBuild.2007-05-05) and then placing it on my host's server and I am still getting the same (fatal) error....

Fatal error: Call to undefined function delete() in /home/username/public_html/rewritetest.php on line 40

Any help would really be appreciated - I've been trying to get this thing to install for two weeks now and I'm just about done. Either done, as in success - or done, as in I'm done trying.

Thanks!
-TC

Avatar
TCJeter

Community Member, 17 Posts

7 May 2007 at 1:06pm

Edited: 07/05/2007 1:08pm

Andy -

Thanks for getting back to me. So would the only edit be changing the 'delete' to 'unlink'? I did do that and got past the error, but I still wind up with my error stating...

mod_rewrite doesn't appear to be working. Make sure:

* mod_rewrite is enabled in your httpd.conf
* AllowOverride is enabled for the current path

And, after I force it I still get the 21 instances of the /~username/ in the URL. Do you have any notion of why that might be happening? Do you think this is something that is specific to the host that I am with? Their help docs state that mod_rewrite is enabled (http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&root=39&id=103)

Thanks for your help.
-TC

Avatar
TCJeter

Community Member, 17 Posts

9 May 2007 at 5:52am

Edited: 09/05/2007 5:54am

Andy -

Just to let you know, I was able to replace the files yesterday with the newest daily build (5-7), and then had to put in the alternative rewrite rule - as explained here http://doc.silverstripe.com/doku.php?id=installing - and then the installation was finally a success!!!

My only simple question right out of the gate is....how do I edit the 'header' title and subtitle within the cms, without having to grab and edit the (code) page itself? It wasn't readily apparent. Note: this is within the new 'black candy' theme that's packaged in the installation.

Thanks for the help so far; I'm sure I'll have other questions as I move along, but at least the installation issue is resolved.

Thanks,
-TC

Avatar
hollyv

Community Member, 2 Posts

29 May 2007 at 5:22am

I got a similar error using a daily build version. Here's what I've discovered...

I'm on hostgator, which supports PHP 4 and 5. PHP 5 has to be called from a domain (domain.com vs. 66.66.66.66/~username) and the back end package, cPanel, has a feature that allows you to choose between PHP 4 and 5.

However, the .htaccess file for PHP4 includes the number 4 in the statement. The PHP 5 statement does not include the "5" ... so the server itself, if you use the built in tweak, certainly knows that you're requesting PHP5, but Silverstripe's default is to assume you're running 4 if it doesn't see the "5"...

I assume this is why the daily builds tend to generate multiple iterations of .htaccess.

I won't tell you how many times I tried installing this... over a period of days... using various builds. I have high hopes for this package and was determined to get it to work.

The errors were being attributed in the forums to PHP5 issues. I knew it had to be a language barrier... and I suspected .htaccess.

I decided to start over one last time:

1. obliterate all files -- all vestiges of silverstripe
2. delete the MySQL database, user and link (create a new set with all new names)
3. manually edit the .htaccess file at your web root to remove all silverstripe commands (otherwise, when you try to reinstall you get the "this seems to have been installed already!")

I wanted a complete Mulligan. The ultimate do-over.

Next:

1. I grabbed a fresh copy of the stable release (not the nightly builds that resolved some problems only to create others) and uploaded it to the server.
2. created a new database/user/and linked them using cpanel's MySQL management ... again, new names.
3. went to the domain.com/install.php and added (a.) the database details and (b.) an admin email and password ... which is incredibly easy to miss? That's why there are so many people who can't login after installing...

Got green lights and a little worried orange over the apache mod rewrite, but had already found and tested "rewritetest.php" in my browser and knew it was working.

Once the install was over? I got a dreadful error message. SSViewer... something.

It didn't really matter what it said.

I looked at .htaccess. Silverstripe had re-written my .htaccess file and had removed the PHP 5 statement altogether. ??

I manually edited .htaccess to add two lines of code -- calling PHP5, and calling it by number right at the top:

AddType x-mapp-php5 .php
AddHandler application/x-httpd-php5 .php

above the line:

### SILVERSTRIPE START ###
RewriteEngine On

Once I did that? I went to the root of my domain and got a happy login.
Whew! Now I can play.

This won't solve everyone's problem but I know it will solve someone's problem so I will not have lived in vain.