-
-
Notifications
You must be signed in to change notification settings - Fork 5
PHP environment setup
WebEngine expects a modern PHP environment with the usual extensions for DOM, JSON, and HTTP-related work. Using gt or Composer will ensure the dependencies are installed correctly. Local development and production do not need to be identical, but they do need to be close enough that behaviour stays predictable.
To develop WebEngine applications locally, we want the following to be installed in our environment:
- PHP version 8.4+
- Composer
- the required PHP extensions: curl, dom, libxml, fileinfo, json, mbstring, pdo, pcntl
- the
gttooling
Once those are installed, verify them before starting a project:
php -v
composer --version
gtFrom there, a project can be run with gt run, with gt serve, by using the PHP development server directly, or by setting up a local web server if you prefer to mirror production more closely.
The most common early problems are:
- missing extensions
- the wrong PHP version
- permission issues
- clashing local services on the same port
It is usually worth checking the PHP binary your shell is actually using, especially on machines with several PHP versions installed.
For production applications, web servers are a requirement.
- File-based routing
- Page views
- Page logic
- Dynamic URIs
- Headers and footers
- Custom HTML components
- Page partials
- Binding data to the DOM
- DOM manipulation
- Hello You tutorial
- Todo list tutorial
- Address book tutorial WIP
- Blueprints
- Application architecture
- Coding styleguide WIP
- PHP environment setup WIP
- Web servers WIP
- Background cron tasks
- Database setup WIP
- Client-side compilation WIP
- Testing WebEngine applications WIP
- Production checklist WIP
- Security WIP