The reload container (docker/web-dev/live.js, browser-sync) now publishes the site's port itself, so the page's socket can connect
(the old proxy ws option moved it to an unpublished port: the tab never followed). The IDE tells it each saved file (POST /__jumphp/notify),
so it works without file events (Docker Desktop also polls); CSS is injected without a reload, anything else reloads once.
Status bar item Live: N (browser tabs connected), open the site at the live-reload address, turn it off ('live': 'off' in web.json).
bin/jumphp web:live, LiveReload (IDE) + tests, end-to-end test with headless Chrome on a Symfony site, docs, 14 languages.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
53 lines
3 KiB
Markdown
53 lines
3 KiB
Markdown
# Web sites
|
|
|
|
The IDE makes and serves PHP web sites with nothing installed but Docker: **Symfony, Laravel, WordPress, PrestaShop, Sylius** and plain
|
|
**PHP**. Any PHP site opened as a project gets the same tools.
|
|
|
|
## Create one
|
|
|
|
**New Project > Web site**: the kind, the folder, the database (MariaDB, PostgreSQL, SQLite, none), the PHP version, and for Symfony
|
|
the Docker setup. The same as `bin/jumphp web:new <kind> <folder>`.
|
|
|
|
## Serve it
|
|
|
|
The run configuration **Serve the site** (`Shift+F10`): FrankenPHP with the site's PHP, the database when it needs one, **live reload**
|
|
(PHP, Twig, JS, config changes reload the browser, CSS is injected without a reload), `npm run watch` or `sass --watch` for the assets; your browser opens on it.
|
|
Addresses are fixed per folder: the site `http://localhost:P`, PHP directly `P+1`, the database `P+2`
|
|
(`mysql://app:[email protected]:P+2/app`; from the site: host `db`). The Symfony toolbar works.
|
|
|
|
**Live reload** (status bar, next to the Git branch: `Live: 2` = 2 browser tabs follow): each file the IDE saves is told to the reload
|
|
container (it works even when the bind mount sends no file events: Docker Desktop), CSS is injected (scroll and state kept), anything else
|
|
reloads the page. Click it: **Open the site in the browser** (the live-reload address, not the raw PHP port), **Turn live reload off / on**
|
|
(restart the site to apply it). Details and the end-to-end test: [docs/web.md](../web.md#live-reload).
|
|
|
|
Run > Site: stop, database, info. **Debug** on Serve the site turns Xdebug on ([Debugger](debugger.md)).
|
|
|
|
## The PHP version (per site)
|
|
|
|
One PHP per site, used by Serve, Composer and the Console, so that Composer's dependencies and the PHP that runs them agree.
|
|
|
|
- Offered: **8.2, 8.3, 8.4, 8.5**.
|
|
- Choose it in the **Console** window's PHP selector or **Docker > Compose > PHP** (`bin/jumphp web:php <folder> 8.4`); kept in
|
|
`.jumphp/web.json`. **auto** goes back to the default.
|
|
- Default: what Composer needs (`config.platform.php`, else the newest version `require.php`, the lock file and the locked packages
|
|
allow); 8.4 without composer.json.
|
|
- Applied to the Docker setup: the JumPHP stack's image, symfony-docker's Dockerfile `FROM`, or your own compose file's PHP image.
|
|
|
|
## The Docker setup
|
|
|
|
**Docker > Compose > Docker setup** (`bin/jumphp web:docker`):
|
|
|
|
| Setup | |
|
|
|---|---|
|
|
| `jumphp` | the stack the IDE writes (`.jumphp/compose.yaml`) plus your `compose.override.yaml` |
|
|
| `dunglas` | [symfony-docker](https://github.com/dunglas/symfony-docker): its Dockerfile and compose files |
|
|
| `compose` | the site's own compose file and service (`php`, `app`, `php-fpm`…) |
|
|
|
|
Customise the stack in `compose.override.yaml` at the site's root; **Add a service** offers MariaDB, PostgreSQL, Redis, Mailpit,
|
|
Adminer, RabbitMQ, Meilisearch… ([Docker](docker.md)).
|
|
|
|
## Local PHP
|
|
|
|
The Console window can use the computer's PHP instead of Docker (**Docker / Local PHP**); Composer then uses it too.
|
|
|
|
More: [docs/web.md](../web.md). Related: [Symfony console](symfony-console.md), [Composer](composer.md), [Database](database.md).
|