SilverStripe CMS pre V3.0

20111128

I had issues with Godaddy linux shared hosting & Silverstripe for the last week..:

The hosting plan has multiple domains names hosted:

  • > 5 multiple Silverstripe sites
  • 1 mediawiki site
  • 2 wordpress sites
  • 1 phpBB site
  • a couple others

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:

  • Tried to override admin userid & password by editing /mysite/_config.php and adding (Didn't work)
Security::setDefaultAdmin('admin','password');
  • Deleted all Member & member password entries from the MySQL database (Didn't work)
  •  Added a new MYSQL database & fresh Silverstripe 2.4.6 install to an empty folder: (Didn't work)
    • It warned re magic_quotes & asp_tags need to be turned off:
    • Edited hosting plan root folder /php5.ini and added:
magic_quotes_gpc = Off;
magic_quotes_runtime = Off;
asp_tags = Off;
  •  
    • To force new settings to get picked up: Hosting control center -> Content -> System processes -> Stopped Web process
    • Didn't proceed with the install until after the above warning came up green per silverstripe install.php
    • Noticed during the install an error flash past but didn't catch it..
    • Install seemd to run ok.  BUT, still cannot login
      • On the new SS install: To force Silverstripe to spit out errors I edited /mysite/_config.php and added:
      Director::set_environment_type("dev");
      • yay,now getting error output:
      [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
      •  
        • Ok, my Godaddy hosting control panel tells me my web root is NOT prefixed by /var/chroot so I assume that is part of the problem
          • Edited /mysite/_config.php & added: (WORKED)
          session_save_path(getTempFolder());
          • yay., can now login ok
          • Cleanup: edited /mysite/_config.php and added:
          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