For simple websites I like to use Kirby: a flat-file CMS written in PHP.
What is a Flat-File Content Management System?
With a flat-file content management system, text content is stored exclusively in files. More about this on CmsCritic.
Since Kirby doesn't need a database connection (as a flat-file CMS it doesn't need a database), you can also run it on the PHP built-in server, so you don't need XAMPP or MAMP:
This has worked fine for me so far but please have a look at the notes on the Kirby website regarding this topic.
For a nicer development experience, I prefer to have a live reload server running that refreshes the page on file change.
To get started, add a
package.json file in the root directory of the Kirby project (it can be generated with
Next, create a file called
browsersync.js, in the root directory of the project, with the following content:
In this file the browser sync server is started, with the options defined in the
package.json. More information about the possible options can be found on the documentation page of Browsersync.
Before you can start the server, some changes have to be made in the `package.json' file:
The entries in detail:
serve-phpStarts the build-in PHP webserver and supresses all
200messages (the console output is very verbose)
syncStarts the BrowserSync server
- Under 'browserSync' the options for the browser sync server are defined:
proxy: The address of the PHP server
watch: The folders that BrowserSync should watch. If a file in them changes, the page is reloaded
ignore: Files that should not trigger a reload
If everything has worked, you can now use
npm run serve
to start the project. A new browser window with the project should open automatically.
Important note: BrowserSync only works if there is a
<body> element in the delivered HTML (more information here).