0
votes

I´m using Silverstripe 4 and created a page with a form. Something gets wrong and I only get a blank page with:

"There seems to have been a technical problem. Please click the back button, refresh your browser, and try again."

  • In .htaccess I set php_flag display_errors on
  • In the _config.php I set error_reporting(E_ALL);
  • And in the mysite/_config/app.yml I set this:

Only: environment: 'dev'

SilverStripe\Security\BasicAuth: entire_site_protected: true

Now all I wanna do is to let Silverstripe show me the errors. In Silverstripe 3 the only thing to do was: Director::set_environment_type("live");

What must I do to show the errors?

2
Are you using PHP-CGI by chance? PHP-CGI does not support php_flag and will throw a server error if these configurations exist in your .htaccess. - Brett Tasker

2 Answers

2
votes

In your .env file, you can specify an environment variable.

SS_ENVIRONMENT_TYPE='dev'

1
votes

The term "There seems to have been a technical problem" is notice for CSRF failure: https://github.com/silverstripe/silverstripe-framework/blob/7603c6d79841df7712c0d1d5136ec402f3162e0c/lang/en.yml#L60

So setting silverstripe to dev mode or tweaking php error levels won't help here as it just outputs that when the csrf check fails.

You need to add the token or prevent the form handler from checking it:

https://docs.silverstripe.org/en/4/developer_guides/forms/form_security/#cross-site-request-forgery-csrf

If everything for the form is right then there is a possibility that the error could be caused by permission issues with PHP and the session write directory.