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.

Migrating a Site to Silverstripe /

What you need to know when migrating your existing site to SilverStripe.

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

More SS 3 issues : set_environment_type() and init()?


Go to End


3 Posts   2755 Views

Avatar
Garrett

Community Member, 245 Posts

10 July 2012 at 7:34am

Hi,

When I get PHP errors in my SS 3 install, I am only getting a generic 500 error instead of a custom SS error, despite having Director::set_environment_type("dev") set in my _config.php.

Also, why am I getting the following error:

PHP Fatal error:  Cannot redeclare Page_Controller::init() in ...../mysite/code/Page.php on line 40

How can I get a chunk of PHP code to run when the page loads without init()?

Thanks,
Garrett

Avatar
Willr

Forum Moderator, 5523 Posts

10 July 2012 at 10:11pm

You can still call init(), works fine on my sites. Check you simply haven't got 2 of the same function pasted in the same file :)

Avatar
Garrett

Community Member, 245 Posts

11 July 2012 at 1:31am

On this one, you were right! init() was already provided in Page.php, it was just at the bottom so I didn't notice it ;) Sorry!

//Garrett