Installing SilverStripe on localhost

Setting up a local development environment for SilverStripe CMS, running the PHP site and backend at http://localhost/silverstripe.


SilverStripe is a PHP CMS framework developed in New Zealand, balancing content management with a developer API, suitable for custom enterprise sites. Local installation allows for theme and DataObject model development.

Prerequisites

Installation Steps

composer create-project silverstripe/installer silverstripe

Place the project in a web-accessible directory or configure the virtual host DocumentRoot to point to public/.

  1. Create a database silverstripe_local using phpMyAdmin.
  2. Copy .env.example to .env and configure the database:
SS_DATABASE_CLASS="MySQLDatabase"
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD=""
SS_DATABASE_NAME="silverstripe_local"
  1. Access the site in your browser at http://localhost/silverstripe (or your public/ URL).
  2. Run /dev/build?flush=1 to initialize the database (development environment).
  3. The default admin can be set during the installation process or in the .env file.

Common Paths

PathDescription
/Frontend
/adminCMS Backend
/dev/buildBuild database schema (development)

Development Tips

  • Themes are located in themes/ or app/src/ (depending on project structure).
  • After modifying models, visit dev/build.
  • Ensure to disable dev/ routes in production.

Frequently Asked Questions

500 Error or Permissions
assets/ and silverstripe-cache/ must be writable by the web server.

Slow Composer Installation
Use a domestic mirror or pre-download dependencies.

URL Rewriting
Apache uses public/.htaccess; Nginx requires configuration of try_files.

Summary

SilverStripe is installed via Composer, accessible locally at http://localhost/silverstripe, with the backend at /admin, making it suitable for PHP developers to customize the CMS.

访客计数:------ Best viewed in Netscape Navigator · 800×600 © LocalHost Run