A personal repository of random information in compensation for a fatigued biological computer
20111128
I had issues with Godaddy linux shared hosting & Silverstripe for the last week..:
The hosting plan has multiple domains names hosted:
I was on an old server at Godaddy from 2006 maybe, defaulting to PHP4 / MySQL 5
Issue 1:
For no reason that I know of, all my Silverstripe sites were suddenly were dying with an error:
Fatal error: spl_autoload() [<a href='function.spl-autoload'>function.spl-autoload</a>]: Class SS_Log could not be loaded in /sapphire/dev/Debug.php on line 245
Only Silverstripe sites were impacted.
I know bugger all about Apache, PHP, Silverstripe so had to fumble my way to a resolution.
The error was appearing after the page was rendered, so was after the final </html> tag. This resulted in Firefox just displaying the error, Chrome at least displayed the page up to the error.
On one account I edited /mysite/_config.php and added:
SS_Log::add_writer(new SS_LogEmailWriter('webmaster@mysite.com'), SS_Log::WARN, '<=');
This resulted in the spl_autoload error changing to be for SS_LogEmailWriter. I feel this supports my gut feeling that something had changed in my Godaddy setup that resulted in Silverstripe calling its error handling possibly for the first time, and as a consequence I then got this error for the first time
I.e. the potential for the error was always there... But what do I know.
Anyway, I had been wanting to move across to Godaddy's 4GH plan as I hoped it would give me better performance. All my sites were slow at times.
So rather than try to persue a resolution for the above I called Godaddy & got my migration underway.
Once that was done I changed my hosting plan default from PHP4 to PHP5 as again, why waste time resolving this problem on PHP4.
Resolution 1: Migrate or change to PHP5
Which then led to:
New Issue 2: Timezone warning
Now visiting any Silverstripe domain and I was seeing a message similar to:
[Warning] date(): It is not safe to rely on the system's timezone settings.
You are *required* to use the date.timezone setting or the date_default_timezone_set() function.
In case you used any of those methods and you are still getting this warning,
you most likely misspelled the timezone identifier. We selected 'xxxxx' for 'xxxxx'
Resolution 2: Edit hosting plan root folder /php5.ini and added date.timezone="Pacific/Auckland";
Which then led to:
Issue 3: Cannot login to Silverstripe CMS
My Silverstripe sites appeared to be running fine from the client perspective but I could no longer log into the admin backend.
Every time I put in my userid & password I was just bounced back to the login page. Aaarg.
So some frustrating googling and after a few days work this is what I tried:
Security::setDefaultAdmin('admin','password');
magic_quotes_gpc = Off;
magic_quotes_runtime = Off;
asp_tags = Off;
Director::set_environment_type("dev");
[Warning] Unknown: open(/var/chroot/home/content/xx/xxxxxx/tmp/sess_5d12824bee24389af7ab8020088c182b, O_RDWR) failed: No such file or directory (2)
GET /
Line 0 in Unknown
session_save_path(getTempFolder());
Director::set_environment_type("live");
SS_Log::add_writer(new SS_LogEmailWriter('webmaster@mysite.com'), SS_Log::WARN, '<=');
Note to self: Godaddy does not allow php variables to be set via a .htaccess file
And thanks to Silverstripe for adding the extra random bullet points above
Upgrade reminders:
Backup DB, Site root
Prior to 2.4:
Delete cms, sapphire, jsparty and replace from latest release
2.4 on (jsparty is now cms/thirdparty):
Delete cms, sapphire and replace from latest release
Then:
Run xxx.com/dev/build