问题
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, '<=');
回答1:
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
回答2:
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.
来源:https://stackoverflow.com/questions/38182206/silverstripe-3-1-wont-change-to-dev-env