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

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 via command line arguments, otherwise gt will interactively ask you how to proceed.

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 can create a file at page/index.html with whatever contents you like.

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 PHP's local development server: php -S 0.0.0.0:8080 vendor/phpgt/webengine/go.php -t www.

Viewing in the web browser

With some page content inside page/index.html and the server running on port 8080, visit http://localhost:8080/ and you should see your page.

That is the static-first approach in its simplest form: begin with plain HTML, check the page in a browser, and add PHP when the page needs dynamic behaviour. The page at page/index.html is visiable at http://localhost:8080/ (the filename "index" is assumed), and you can create any other page name such as page/example.html that will be visible at http://localhost:8080/example/


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

Clone this wiki locally