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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

proper / best way to upload site onto a server


Go to End


6 Posts   3066 Views

Avatar
oldwrinkly

Community Member, 34 Posts

5 June 2010 at 10:03am

The reason of asking is an addon to my `database errors` post below.

3 times I have done a fresh install of 2.4 on 34SP host, which installs ok, can use cms ok, can run /dev/build/ ok.

The problems /errors come when I upload my theme / site / modules and import database, all of which run on localhost no problem.

Is it best to upload everything at once or piecemeal? is one way any more likely to succeed than another?

Is there anything that needs altering or configuring differently before uploading to another server?

Seeing as I get different but serious errors each time, I presume the problem is in the process rather than the code

Any advice would be appreciated

Regards
Mike

Avatar
Willr

Forum Moderator, 5523 Posts

6 June 2010 at 12:00pm

A guide is available at http://doc.silverstripe.org/recipes:publishing-to-web-server. If you post the specific errors you get on the live site we can help point you in the right direction. Could even be a simple fix!.

Avatar
oldwrinkly

Community Member, 34 Posts

6 June 2010 at 10:45pm

Willr
Thanks for the reply

after a fresh install of 2.4, the config.php is overwritten, I upload my config.php to include...

ini_set('memory_limit','256M');
Director::set_environment_type("Dev");
require_once('conf/ConfigureFromEnv.php');

I run /dev/build which puts these lines ABOVE the database

* Director::set_environment_type(Dev)
Line 28 of _config.php
* require_once(/var/www/vhosts/kentishweald.co.uk/httpdocs/mysite/_config.php)
Line 7011 of manifest-main
* require_once(/var/www/vhosts/kentishweald.co.uk/httpdocs/silverstripe-cache/manifest-main)
Line 66 of ManifestBuilder.php
* ManifestBuilder::include_manifest()
Line 205 of Core.php
* require_once(/var/www/vhosts/kentishweald.co.uk/httpdocs/sapphire/core/Core.php)
Line 61 of main.php
Environment Builder (formerly db/build)

Entering /mysite/admin, these lines are at the top of all pages with most admin buttons missing.

If I drop the database and upload my site complete with importing my database, run /dev/build and get this error...

[User Error] Couldn't run query: SHOW FULL FIELDS IN "Member" Table 'SS_mysite.Member' doesn't exist
GET /dev/build/?flush=all

Line 536 in /var/www/vhosts/kentishweald.co.uk/httpdocs/sapphire/core/model/MySQLDatabase.php
Source

527 }
528
529 function databaseError($msg, $errorLevel = E_USER_ERROR) {
530 // try to extract and format query
531 if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
532 $formatter = new SQLFormatter();
533 $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
534 }
535
536 user_error($msg, $errorLevel);
537 }
538
539 /**
540 * Return a boolean type-formatted string
541 *
542 * @param array $values Contains a tokenised list of info about this data type

Trace

* Couldn't run query: SHOW FULL FIELDS IN "Member" Table 'SS_mysite.Member' doesn't exist
Line 536 of MySQLDatabase.php
* MySQLDatabase->databaseError(Couldn't run query: SHOW FULL FIELDS IN "Member" | Table 'SS_mysite.Member' doesn't exist,256)
Line 134 of MySQLDatabase.php
* MySQLDatabase->query(SHOW FULL FIELDS IN "Member",256)
Line 126 of DB.php
* DB::query(SHOW FULL FIELDS IN "Member")
Line 343 of MySQLDatabase.php
* MySQLDatabase->fieldList(Member)
Line 285 of DB.php
* DB::fieldList(Member)
Line 850 of Security.php
* Security::database_is_ready()
Line 28 of DevelopmentAdmin.php
* DevelopmentAdmin->init()
Line 136 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 283 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 127 of Director.php
* Director::direct(/dev/build/)
Line 127 of main.php

Yet the member and member password entries are in the database

Sean gave a couple of suggestions which did not work

I seem to be stumped every which way I try to install, I just hope someone can help

Regards
Mike

Avatar
Willr

Forum Moderator, 5523 Posts

7 June 2010 at 3:22pm

[User Error] Couldn't run query: SHOW FULL FIELDS IN "Member" Table 'SS_mysite.Member' doesn't exist
GET /dev/build/?flush=all

That comes up when it does something like a CurrentMember check (which queries the member table) but as the database doesn't exist then the query fails.

Possible reasons that it would do a member check when doing a /dev/build is that you were previously logged in so log out by visiting site.com/Security/logout, also ensure it runs the /dev/build in devmode mode by visiting /dev/build?isDev=1

Avatar
oldwrinkly

Community Member, 34 Posts

8 June 2010 at 10:46am

Edited: 08/06/2010 10:50am

Willr
Thanks for your help, I managed to import the database ok and running dev/build?isDev=1 did the trick, it installed ok

The trying to flush the cache with /admin/?flush=1 I got this error plus a long list it could not query....

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

[User Error] Couldn't run query: SELECT "SiteTree"."ClassName", ...etc: etc:

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

GET /Security/login?BackURL=%2Fadmin%2F%3Fflush%3D1

Line 536 in /var/www/vhosts/kentishweald.co.uk/httpdocs/sapphire/core/model/MySQLDatabase.php
Source

527 }
528
529 function databaseError($msg, $errorLevel = E_USER_ERROR) {
530 // try to extract and format query
531 if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
532 $formatter = new SQLFormatter();
533 $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
534 }
535
536 user_error($msg, $errorLevel);
537 }
538
539 /**
540 * Return a boolean type-formatted string
541 *
542 * @param array $values Contains a tokenised list of info about this data type

-------------------------
I have got these errors in the server log, Is this a memory issue?

Mon Jun 07 22:56:27 2010] [error] [client 195.137.8.183] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 41650 bytes) in /var/www/vhosts/kentishweald.co.uk/httpdocs/sapphire/profiler/Profiler.php on line 88
[Mon Jun 07 23:33:28 2010] [error] [client 195.137.8.183] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 86 bytes) in /var/www/vhosts/kentishweald.co.uk/httpdocs/sapphire/core/model/ErrorPage.php on line 222
[Mon Jun 07 23:33:48 2010] [error] [client 195.137.8.183] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 232 bytes) in /var/www/vhosts/kentishweald.co.uk/httpdocs/sapphire/core/model/ErrorPage.php on line 222

Can anyone help with this please

Regards
Mike

Avatar
Willr

Forum Moderator, 5523 Posts

8 June 2010 at 9:06pm

Yes according to your error log you are running out of memory (currently 32mb). We recommend a minimum of 64mb. I run even my small sites with 128mb.