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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Enviroments doenst work


Go to End


7 Posts   1372 Views

Avatar
StefanX201

Community Member, 9 Posts

24 April 2014 at 2:32am

I followed this but doesnt work

http://doc.silverstripe.org/framework/en/topics/environment-management

My Structures

4 drwxrwxr-x 5 stefan stefan 4096 Apr 23 15:52 assets
4 drwxrwxr-x 7 stefan stefan 4096 Apr 23 16:18 cache
0 lrwxrwxrwx 1 stefan stefan    9 Apr 23 15:53 cms -> ../../cms
0 lrwxrwxrwx 1 stefan stefan   19 Apr 23 15:53 composer.json -> ../../composer.json
0 lrwxrwxrwx 1 stefan stefan   19 Apr 23 15:53 composer.lock -> ../../composer.lock
0 lrwxrwxrwx 1 stefan stefan   17 Apr 23 15:53 favicon.ico -> ../../favicon.ico
0 lrwxrwxrwx 1 stefan stefan   16 Apr 23 15:53 flexslider -> ../../flexslider
0 lrwxrwxrwx 1 stefan stefan   15 Apr 23 15:53 framework -> ../../framework
0 lrwxrwxrwx 1 stefan stefan   13 Apr 23 15:53 gallery -> ../../gallery
0 lrwxrwxrwx 1 stefan stefan   15 Apr 23 15:53 index.php -> ../../index.php
4 drwxrwxr-x 4 stefan stefan 4096 Apr 23 16:26 mysite
0 lrwxrwxrwx 1 stefan stefan   15 Apr 23 15:53 README.md -> ../../README.md
0 lrwxrwxrwx 1 stefan stefan   11 Apr 23 15:53 sites -> ../../sites
4 -rw-rw-rw- 1 stefan stefan  488 Apr 23 16:18 _ss_environment.php
4 drwxrwxr-x 3 stefan stefan 4096 Apr 23 15:52 themes
0 lrwxrwxrwx 1 stefan stefan   18 Apr 23 15:53 translatable -> ../../translatable
0 lrwxrwxrwx 1 stefan stefan   12 Apr 23 15:53 vendor -> ../../vendor
0 lrwxrwxrwx 1 stefan stefan   16 Apr 23 15:53 web.config -> ../../web.config
stefan@stefanX201 /data/www/silverstripe/sites/test $ 

my _config.php in mysite folder:

<?php 
global $project;
$project = 'mysite';
 
global $database;
$database = '(databasename)';

// Use _ss_environment.php file for configuration
require_once("conf/ConfigureFromEnv.php");

My _ss_environment.php file

<?php
define('TEMP_FOLDER', __DIR__ . '/cache');
define('SS_DATABASE_NAME', 'silverstripe');
define('SS_DATABASE_SERVER', 'localhost');
define('SS_DATABASE_USERNAME', 'devuser');
define('SS_DATABASE_PASSWORD', 'devuser');
define('SS_DEFAULT_ADMIN_USERNAME', 'admin');
define('SS_DEFAULT_ADMIN_PASSWORD', 'stefan');
define('SS_ERROR_LOG', __DIR__ . '/silverstripe.log');

global $_FILE_TO_URL_MAPPING;
$_FILE_TO_URL_MAPPING['/data/www/silverstripe/sites/test'] = 'http://silverstripe.dev';

I deleted the whole cache with rm -rf ... but still:
SilverStripe Framework requires a $databaseConfig defined.

Please help me

Avatar
camfindlay

Forum Moderator, 267 Posts

24 April 2014 at 2:43am

I'm interested as to why you have all these symlinks? Can you explain more about your server configuration, I suspect that how you are approaching things might be having an impact of how things are done with SilverStripe's structure. So you might run up against other issues.

Which OS? Are you using apache? which version of SilverStripe?

I use the environments all the time so I know they work, just curious as to how we get it to work for your use case.

Avatar
StefanX201

Community Member, 9 Posts

24 April 2014 at 3:19am

Edited: 24/04/2014 3:36am

My Dev Machine is a Linuxmint with nginx. I got the same problems with apache in a vagrant Virtual-Machine.

I use the symlinks to reduce code redundancy on my Server. Another Advantage is that it is easier to Maintain.

The Structure should look like below after a little cleanup

4 drwxrwxr-x 5 stefan stefan 4096 Apr  4 11:29 assets
4 drwxrwxr-x 7 stefan stefan 4096 Apr 23 16:18 cache
0 lrwxrwxrwx 1 stefan stefan    9 Apr 23 15:53 cms -> ../../cms
0 lrwxrwxrwx 1 stefan stefan   16 Apr 23 15:53 flexslider -> ../../flexslider
0 lrwxrwxrwx 1 stefan stefan   15 Apr 23 15:53 framework -> ../../framework
0 lrwxrwxrwx 1 stefan stefan   13 Apr 23 15:53 gallery -> ../../gallery
0 lrwxrwxrwx 1 stefan stefan   15 Apr 23 15:53 index.php -> ../../index.php
4 drwxrwxr-x 4 stefan stefan 4096 Apr 23 16:26 mysite
0 lrwxrwxrwx 1 stefan stefan   15 Apr 23 15:53 README.md -> ../../README.md
0 lrwxrwxrwx 1 stefan stefan   11 Apr 23 15:53 sites -> ../../sites
4 -rw-rw-rw- 1 stefan stefan  493 Apr 23 16:33 _ss_environment.php
4 drwxrwxr-x 3 stefan stefan 4096 Apr  3 22:35 themes
0 lrwxrwxrwx 1 stefan stefan   18 Apr 23 15:53 translatable -> ../../translatable
0 lrwxrwxrwx 1 stefan stefan   12 Apr 23 15:53 vendor -> ../../vendor

For Example:
All Core files for every Project should place in /var/www/silverstripe.
Projects should placed in

/var/www/silverstripe/sites/X
/var/www/silverstripe/sites/Y
/var/www/silverstripe/sites/Z

-----------------------------------------------------

Now i revert everything and set it back to the originally setup without _ss_env.. ,without symlinks and delete all the cache but can't get it to run anymore :(

<?php

global $project;
$project = 'mysite';
 
global $databaseConfig;
$databaseConfig = array(
	"type" => 'MySQLDatabase',
	"server" => 'localhost',
	"username" => 'devuser',
	"password" => 'devuser',
	"database" => '	silverstripe',
	"path" => '',
);

<?php

global $project;
$project = 'mysite';

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

Please see attached files for the Error that i can't comprehend

Attached Files
Avatar
StefanX201

Community Member, 9 Posts

24 April 2014 at 4:12am

Edited: 24/04/2014 4:27am

Silverstripe is nice but always mystic :/

Now it works... even with symlinks.

Ok "sake" will not work with that Structure but isnt necessary :)

Avatar
camfindlay

Forum Moderator, 267 Posts

24 April 2014 at 10:08am

Are you running any opcode caching perhaps that is causing issues?

Are you saying that it is now working? If so if you can find the cause and report back that might help others. Would also suggest changing the topic of your post to include something about your symlink setup, again to help people with similar problems find these discussions and learn from them :) "Environments doesnt work" doesn't really help describe your specific problem.

Avatar
StefanX201

Community Member, 9 Posts

24 April 2014 at 7:16pm

You are right, i will send a setup guide later. I'm also fixing the Docs during reading.

Avatar
camfindlay

Forum Moderator, 267 Posts

24 April 2014 at 9:06pm

BE sure to check out the documentation contribution information if you are going to be updating the docs :)

http://doc.silverstripe.org/framework/en/trunk/misc/contributing/documentation