0

My site is on live online server, after installing few modules (user definded forms) via SSH and Composer i get 500 internal server error. I try to run /dev/build/?flush but nothing is happening. Again the some error!

I check in chrome to inspect in network tab and there is also 500. So dev env in not enabled.

I try to enable it:

_config.php

Config::inst()->update("Director", "environment_type", "dev");

config/config.yml :

Director:
  environment_type: 'dev'

And nothing is happening. It wont to change on dev env to allowe me to run dev/build?flush. I realy dont know what i do wrong.

I also try this way inside _config.php

ini_set('display_errors', 1);
error_reporting(E_ALL);
Director::set_environment_type('dev');
SS_Log::add_writer(new SS_LogFileWriter('./logs/'), SS_Log::WARN, '<=');
Ivan
  • 5,139
  • 11
  • 53
  • 86
  • sometimes the ini set stuff just won't work depending on server settings... if this is just plain apache - have you just looked in the error_log for the result? Also is there anything in the logs folder you've set to be written to? – Barry Jul 04 '16 at 10:32
  • Nope, i check now. There does not exist any pain apache file. And also i dont have access to see error_log on this hosting – Ivan Jul 04 '16 at 10:40
  • you should add the log writer for SS_Log::ERROR also. And hopefully you CAN write the log with php. You might want create Also you could try to create a `silverstripe-cache` folder under the web root, or clear the contents if there is one. Unless you have access to clear that from `/tmp/` that could also help. Otherwise id suggest on going back to the workin composer config and hope that the dev/b – Olli Tyynelä Jul 04 '16 at 10:52
  • Dangit.. accitental enter and couldnt ament the comment more than 5 minutes :) Here the rest of the missing bits that should have been in that one. Anyways: you could try to run `find . -name error_log` in the www root folder. And if you can go back to a working state ping the hosting company to send you the logs.. Otherwise this is really hard to debug. – Olli Tyynelä Jul 04 '16 at 11:02
  • on the SS_LOG:s I'd suggest on creating the files first on the webroot and checking that their permissions are so that PHP can absolutely write in them before hoping to see something in them. – Olli Tyynelä Jul 04 '16 at 11:04

2 Answers2

0

This will always put SilverStripe in dev environment.

_config.php

require_once("conf/ConfigureFromEnv.php"); //add this

global $project;
$project = 'mysite';

global $databaseConfig;
//Database configuration

_ss_environment.php

define('SS_ENVIRONMENT_TYPE', 'dev');
error_reporting(E_ALL);
ini_set('display_errors', '1');

define('SS_DATABASE_SERVER', 'localhost');
define('SS_DATABASE_USERNAME', '');// you can leave this empty if you defined this in your _config.php
define('SS_DATABASE_PASSWORD', '');// you can leave this empty if you defined this in your _config.php
Fatal Error
  • 1,024
  • 6
  • 12
0

You can change to dev environment quickly for the current session if you add ?isDev=1 to your URL, see docs.

If it still doesn't work you need to set up error logging and/or get the webserver error log to see what's going wrong.

As you installed a module in command line ... did you run

./framework/sake dev/build ?flush=1

from your webroot in ssh (see cli docs) to rebuild the database? If not, please try it and be sure it ends with "done", otherwise look out for error messages.

wmk
  • 4,598
  • 1
  • 20
  • 37