Silverstripe. Uploaded to live. Getting “SilverStripe Framework requires a $databaseConfig defined.”

限于喜欢 提交于 2019-12-08 16:33:14

问题


I've uploaded a site to the live server, imported the database and updated the db connection info in mysite/_config.php but am getting the following error:

SilverStripe Framework requires a $databaseConfig defined.

This appears to come from framework/main.php where it is checking my to make sure my config is defined. Here is my config:

global $databaseConfig;
$databaseConfig = array(
    "type" => 'MySQLDatabase',
    "server" => 'localhost',
    "username" => 'xxxxx',
    "password" => 'xxxxx',
    "database" => 'xxxxxx',
    "path" => '',
);

I published the site in the same manner to one of my servers so the client could check before setting live and it worked with no issues.

Anyone have any ideas what could be going on?


回答1:


Considering what you posted here: Silverstripe mod_rewrite issue (I think)

Seems to be most likely related to a missed configured .htaccess, maybe because the site didn't run through the SS install process.

Try adding a RewriteBase '/' in your .htaccess updating the folder to match your host config. If all fails, try running the SS installer which eventually will setup the .htaccess properly.




回答2:


for anyone else with this issue try putting /dev/build?flush=1 on the end of your url



来源:https://stackoverflow.com/questions/20384423/silverstripe-uploaded-to-live-getting-silverstripe-framework-requires-a-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!