Skip to content
Greg Bowler edited this page May 11, 2026 · 18 revisions

This page is the shortest route from a fresh machine to a running WebEngine application. If you want more background on installation choices, see Installation. Here we will keep to the fastest useful path first.

Install gt

The gt command is the small command line wrapper around the normal tasks of starting, building, and testing a WebEngine project. If you have not installed it yet, follow the short install route:

curl https://install.php.gt | sh

Once that is done, run gt on its own. If a command list appears, the tooling is ready.

Create a New Project

To create a new project, choose a directory where you keep your code and run:

gt create my-first-app
cd my-first-app

By default this creates a minimal WebEngine project with the standard directory layout and a starter page. You can also choose a namespace and blueprint:

gt create my-first-app --namespace App --blueprint Hello-World

The project name becomes the directory on disk. The namespace controls the PHP namespace used for classes in the project. A blueprint is a starter project shape. If you omit it, you get an empty application scaffold.

Manually create a project without gt create

If you prefer not to use gt create, you can still create a project by hand:

mkdir my-first-app
cd my-first-app
composer require phpgt/webengine

From there you need a page/ directory, a www/ document root, and the normal Composer autoloading setup for your own PHP classes. The manual route is completely workable, but gt create saves a few early setup steps and makes it easier to start with a known-good project shape.

Run the Project

From the project root, run:

gt run

This starts the local development server and, where needed, also runs the build watcher and cron watcher for the project. In a tiny starter app those extra pieces do very little, but once the application grows they become part of the normal development loop.

If you only want the PHP server, use:

gt serve

Without gt, the local server can still be started with the server package directly once the dependencies are installed, but for most projects gt run is the simplest option.

Make the First Change

Open page/index.html and change the starter content to something of your own:

<!doctype html>
<h1>Hello, World!</h1>

Refresh the browser and the change should appear immediately. That is the static-first approach in its simplest form: begin with plain HTML, check the page in a browser, and only then add PHP when the page needs behaviour.


Check out the gt command overview, or move on to building our first page in Hello World tutorial.

Clone this wiki locally