Configuration File

The Pagekit configuration file is automatically created when you install Pagekit. If you want to change configuration settings manually, this article explains syntax and content of the file.

Usually, you do not need to fiddle with the configuration file config.php after it has been created by the installer. The normal way of changing configuration is through System > Settings in the Pagekit admin panel.

Sometimes manually editing this file is still necessary and useful, for example when troubleshooting a broken installation or when moving an existing Pagekit installation to a new server.

In the following code listing you see an example configuration with the most common settings.

Usually you only have one database connection present. The example includes both examples to show how configuration works for different database drivers. Only the default connection will be used by Pagekit (in this example sqlite is used).

  1. 'database' => [
  2. 'default' => 'sqlite', // default database connection
  3. 'connections' => [ // array of database connections
  4. 'sqlite' => [ // database driver name, here: sqlite
  5. 'prefix' => 'pk_', // prefix in front of every table
  6. ],
  7. 'mysql' => [ // database driver name, here: mysql
  8. 'host' => 'localhost', // server host name
  9. 'user' => 'user', // server user name
  10. 'password' => 'pass', // server user password
  11. 'dbname' => 'pagekit', // database name
  12. 'prefix' => 'pk_' // prefix in front of every table
  13. ],
  14. ]
  15. ],
  16. 'system' => [
  17. 'secret' => 'secret' // a secret string generated during installation
  18. ],
  19. 'system/cache' => [
  20. 'caches' => [
  21. 'cache' => [
  22. 'storage' => 'auto' // the cache method to be used, if enabled
  23. ]
  24. ],
  25. 'nocache' => false // the cache state - disable entirely by setting to true
  26. ],
  27. 'system/finder' => [
  28. 'storage' => '/storage' // relative path to a folder used for uploads, cache etc.
  29. ],
  30. 'application' => [
  31. 'debug' => false // debug mode state, enable while developing to get debug output
  32. ],
  33. 'debug' => [
  34. 'enabled' => false // debug toolbar state, enable to get information, about requests, routes etc.
  35. ]