Skip to the content
Documentation
Manuals

Setting up a development installation

A development installation in a few commands: Git clones, Composer, exp:install on SQLite, Velocity, debug settings, and the rules that keep it apart from live.

  • Topic type: Concept
  • For: Visitors Developers Designers Application creators
  • doc.help.extension-development.part-1-from-user-to-developer.setting-up-1e912b0a
  • Last changed
  • JSON
On this page

Part 1, chapter 4. You never develop on a live site. This chapter sets up an installation of your own where you can break things, read the debug output and try every example in this book. It takes a few commands; everything after the clone is the same whether you work on a laptop, a virtual machine or a container.

What you get

  • The kernel and every extension as Git clones, so you can read their history and keep your changes on a branch.
  • A database in one SQLite file, so there is no database server to set up.
  • A web server started with one command.
  • Debug output switched on, so errors are shown instead of hidden.

Step 1: get the code as Git clones

Tell Composer once to install every se7enxweb/* package as a Git clone:

composer config --global 'preferred-install.se7enxweb/*' source

Then clone the kernel, start your own branch and install the packages:

git clone https://github.com/se7enxweb/exponential.git
cd exponential
git switch -c my-dev
composer install

The first composer install takes a few minutes: it clones every extension the kernel's composer.json requires into extension/<name>, each a Git repository of its own. The full explanation, including how to update later, is in Getting the code and Develop with Git.

Check:

ls -d extension/*/.git | wc -l
git -C extension/eztags log --oneline -3

Expected: a number of extension clones, and the last three commits of one of them.

Step 2: install with one command

php bin/php/console exp:install --apply

With no options this installs the sevenx_multisite site package on SQLite, in eng-US, and prints a summary with the site address, the administration login and a generated administrator password (also written to var/log/initial-admin-password, readable by its owner only). Every option, and the other databases, are documented in The console install.

Many developers add a shortcut so that ./console works from the root:

ln -s bin/php/console console
./console list | head

The shortcut is not part of the distributed files; this book writes ./console and assumes you made it.

Warning

exp:install refuses to run over an existing installation unless you pass --force, and its default --db-action=remove empties the database it is given. On your own development machine with SQLite that is what you want. Never point it at a database that holds anything you care about.

Step 3: start a web server

The quickest is Velocity with PHP's built-in server engine, the shipped default:

./console exp:velocity start

settings/velocity.ini ships with [ServerSettings] Engine=php, which runs php -S with the router bin/php/velocity-router.php; its port is set in [PHPServerSettings] (8087 by default, see Serving the site). Open the address the summary of exp:install printed, then the administration. For an Apache or nginx setup, the same chapter has complete examples.

Step 4: make mistakes visible

A live site hides its errors from visitors. A development site should show them. Make the changes in your own settings extension or the override directory of your development machine, never in settings/site.ini itself:

./console exp:ini set site.ini/DebugSettings/DebugOutput enabled global --allow-root-user
./console exp:ini set site.ini/TemplateSettings/ShowUsedTemplates enabled global --allow-root-user
./console exp:ini set site.ini/TemplateSettings/TemplateCompile disabled global --allow-root-user
php bin/php/ezcache.php --clear-tag=ini --allow-root-user
SettingDefaultOn a development machineWhat it does
[DebugSettings] DebugOutputdisabledenabledErrors, warnings, timing and SQL appear below each page
[TemplateSettings] ShowUsedTemplatesdisabledenabledThe debug output lists every template a page used, and which override chose it
[TemplateSettings] TemplateCompileenableddisabled while you edit templatesTemplates are read fresh on every request instead of from the compiled cache
[TemplateSettings] ShowTemplatePathCommentsdisabledenabled when you hunt for a templateHTML comments in the page source name the template of each part

exp:ini set ... global writes settings/override/site.ini.append.php and keeps a backup; --dry-run shows the change first. The settings are explained in Debug output and logs for developers.

Tip

Debug output is shown to everyone who can open the page unless you limit it. On a machine only you can reach, that is fine. Anywhere else, use DebugByIP=enabled with DebugIPList[], or DebugByUser=enabled with DebugUserIDList[], both in [DebugSettings].

Step 5: a place for your own extensions

Create a folder for the extension you will build in the tutorials and put it under version control from the start:

mkdir -p extension/mysite_hello
git -C extension/mysite_hello init

If you prefer to keep your own extensions outside extension/, the kernel can search additional folders; see Extensions in more than one folder.

Rules that keep development and live apart

RuleWhy
Never develop on the live siteA typo in a template or a settings file takes the page down for every visitor.
Never copy settings/override/ from live to development or backIt holds database passwords and host-specific values. Each machine keeps its own.
Use a copy of live content only when you mustLive content can contain personal data. A fresh exp:install with the demo package is usually enough.
Commit your extension, not the kernelYour work lives in extension/<yours>; the kernel is updated through Composer and Git, not by your edits.
Turn debug output off before anything goes liveDebug output reveals paths, SQL and settings.

When something goes wrong

SymptomWhat to check
composer install stops with a PHP version errorphp -v; the kernel needs PHP 8.0 or later (PHP 7.4 usable without support)
exp:install stops before the summaryits own message names the check that failed; the log is in var/log/
The site shows a blank pagevar/log/error.log, and the PHP error log of your web server
A change to a template has no effecttemplate compilation: clear the template cache, or set TemplateCompile=disabled while developing
A new class is not foundphp bin/php/ezpgenerateautoloads.php -e, then clear the caches

Become an Exponential Partner. Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster. Start with Partners: start here and How to apply.

Was this helpful?

Only your answer is kept, not who you are.

Something wrong on this page? Report an error