First steps with the SilverStripe Open Source CMSFeb 5th, 2009 | By Christian Donner | Category: Content Management, Open Source
I learned about SilverStripe through an article in the German C’t magazine. The way it can be extended seems to be cleaner and better servicable than it’s competitors. The website of the 2008 Demcocratic Convention was built with SilverStripe, which should address concerns about scalability.
I decided to try it out, since our clients at pod frequently ask for Open Source content management solutions, and SilverStripe could be a perfect platform for LAMP implementations.
In this first post, I am describing how to obtain the software and how I got it up and running at my ISP. In subsequent posts, I will walk through the steps that were required to convert our company web site from an ASP site with static content to SilverStripe.
Downloading and extracting the SilverStripe archive
In the following command line examples, the ¬ character is used to indicate that the command continues on the following line due to space contraints of the blog page.
The first step was to create a directory under the HTML root on the shared server at my web hoster (webhostingbuzz.com). I decided to call the new folder silverstripe, since I did not intend to set up a domain for the site, and I am just going to use it for learning the product.
Next, I downloaded the archive from the SilverStripe.org site, uncompressed it, and extracted the files into my newly created folder:
Now, since everything was untared into a new folder called SilverStripe-v2.2.3 underneath my /www/silverstripe folder, I moved the files up one level. Alternatively, I could have started in my www folder and then renamed the subfolder, but I don’t like to experiment with files in my html root folder.
Now the files were in place and I was ready to hit the SilverStripe installation page at http://cdonner.com/silverstripe (don’t try to hit this URL - I just made it up for this post).
Preparing to run the SilverStripe Installer
Ouch, what happened? A quick Google search for the error revealed that I am not running PHP 5 by default. So I did another test:
Looked like 5.2.5 to me. So why the error? To make the long story short, while PHP 5 is installed on the server, Apache does not use it by default. In order for the correct version to be used for SilverStripe, I needed to edit the file .htaccess (mind the period in the filename – it is important), which was previously empty, to contain the following two lines (the file will grow during the installation process, though, and will ultimately contain a lot more lines):
Now the error went away and Apache served the installer page (if you type http://yourdomain/silverstripe into your browser’s address bar). A quick scan of the page revealed that yes, I still had to set up a MYSQL database, but after scrolling down further to the bottom I found another issue – not enough memory for PHP, in big red letters.
I confirmed that the limit is 8M by creating a phpinfo.php page in my silverstripe folder with one line of code in it:
When I hit this page, I saw that the PHP memory limit was indeeed 8M. Other sources suggest that the PHP memory limit can be set in the server’s the php.ini, or by adding a line to the .htaccess file. Neither worked for me. I created a local php.ini instead with the following content:
This file needs to be in the silverstripe folder and, in order for the installation to be successful, also in the silverstripe/sapphire folder. I refreshed the Installer page – heureka, the warning went away and the “Install SilverStripe” button became available.
The only things left to do were creating a database (I used myPHPAdmin, which is available on my provider’s administration site), creating a database user (which I did directly on my hosting administration page), and entering the database information on the SilverStripe Installer page, along with the administrator password. Once the database was created, I clicked on Install, and it completed successfully.