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.

General Questions /

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

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

404 Error following tutorial 1


Go to End


9 Posts   4870 Views

Avatar
jogr

Community Member, 5 Posts

15 May 2009 at 9:55pm

Hi out there,

as being a silverstripe newbie I fount it a good idea to follow the online tutorials. Everything worked fine, until I get to point "creating a new page type" http://doc.silverstripe.org/doku.php?id=tutorial:1-building-a-basic-site#creating_a_new_page_type

As outlined, I tried to call www.domain.tld/silverstripe/dev/build?flush=1 after creating the php - File and get a 404 Error:

Not Found

The requested URL /silverstripe/dev/build was not found on this server.
Has anyone an idea why I got the above error? The used silverstripe version is 2.3.1

Avatar
PGiessler

Community Member, 47 Posts

15 May 2009 at 10:49pm

Hello,

I think you have a bug in your PHP Source Code. So the CMS can't create dev/build. You can post your source code, so I can help you. Sometimes it's a simple syntax error in the file, and this can make a SilverStripe crash without any error code.

Best regards,

Pascal

Avatar
jogr

Community Member, 5 Posts

15 May 2009 at 11:16pm

Hello,

I must agree, I didn't understand exactly, what you've meant.

me@server:/path/to/domain.tld/silverstripe/mysite/code # ls -al
total 8
drwxr-xr-x 2 10006 10006  104 May 15 10:10 .
drwxr-xr-x 4 10006 10006  136 Mar 20 03:01 ..
-rwxr-xr-x 1 10006 10006  208 May 15 10:10 HomePage.php
-rwxr-xr-x 1 10006 10006 1209 Mar  2 05:24 Page.php
me@server:/path/to/domain.tld/silverstripe/mysite/code # cat HomePage.php
<?php
/**
 * Defines the HomePage page type
 */

class HomePage extends Page {
   server $db = array(
   );
   server $has_one = array(
   );

}

class HomePage_Controller extends Page_Controller {

}
?>

Avatar
PGiessler

Community Member, 47 Posts

15 May 2009 at 11:27pm

I have to adjust your source code. Now it should work!

<?php
/**
* Defines the HomePage page type
*/

class HomePage extends Page {

static $db = array(); // this have to be declared as static

static $has_one = array(); // this have to be declared as static

}

class HomePage_Controller extends Page_Controller {

}
?>

Avatar
jogr

Community Member, 5 Posts

15 May 2009 at 11:48pm

Taking your adjustment unfortunately didn't seem to solve the problem

me@server:/path/to/domain.tld/silverstripe/mysite/code # cat HomePage.php
<?php
/**
* Defines the HomePage page type
*/

class HomePage extends Page {
static $db = array();
static $has_one = array();
}

class HomePage_Controller extends Page_Controller {
}
?>

www.domain.tld/silverstripe/dev/build?flush=1 still causes a 404 error.

Avatar
PGiessler

Community Member, 47 Posts

17 May 2009 at 9:07am

Hello,

You can try to change your rights of your SilverStripe folder. Set the folder into 777 (only for test). Maybe one or more files don't have enough rights, so SilverStripe can't find /dev. I hope this is the solution of your problem.

Best regards,

Pascal

Avatar
jogr

Community Member, 5 Posts

18 May 2009 at 2:58am

I've tried your advise setting rights to 777 without having success.
After that I deleted the old silverstripe installation and set up a new one. After the install process finished I think I've got a hint, why /dev/build?flush=1 fails.
I got the following message, which I didn't realized last time.
Friendly URLs are not working. This is most likely because mod_rewrite isn't configuredcorrectly on your site. Please check the following things in your Apache configuration; you may need to get your web host or server administrator to do this for you:

* mod_rewrite is enabled
* AllowOverride All is set for your directory

As mod_rewrite is enabled on the server (works fine under drupal) I've changed the virtual host configuration by adding
<directory /path/to/domain.tld>
AllowOverride All
</directory>

Trying to reinstall silverstripe (reloading the "Installing SilverStripe..." - page) to see wether the warning appears or not, the warning persits.

Avatar
jogr

Community Member, 5 Posts

19 May 2009 at 7:47am

I've solved my problem. I have deleted an unnecessary subdomain (linked to another subdirectory which was not connected to the silverstripe subdir) and after that, AllowOverride All worked.

Thanks for help and patience.

Go to Top