# Live Server and native local servers Copyright © 2026 Hamza Arya. Arya Code. [Contact and support](https://hamzaarya.com/contact). Open the **Arya Code** navigation tab and choose **Local Servers**, or use the Arya Code command menu. The Command Palette also offers **Arya Code: Open Local Servers**. Arya Code starts native PHP, MySQL and optional Redis processes directly on Windows and macOS. Opening a project and creating local servers do not use Docker. ## Live Server The **Local servers** page includes a built-in **Live Server** for static HTML, CSS and JavaScript. Choose a document root inside the current workspace (`.`, `public`, or `dist`) and a preferred port, then select **Start Live Server** and **Open Live Server**. The command menu also offers **Start Live Server**, **Open Live Server**, and **Stop Live Server**. No PHP or Node project installation is required. Live Server binds to `127.0.0.1`, starts at port `5500` by default, and tries up to 20 consecutive ports when another process already owns a port. HTML pages receive a small reload client; saved changes in nested folders trigger a debounced browser reload through a persistent event stream. Pages with a restrictive Content Security Policy may need to permit the injected inline client. The page shows the actual address, request count, reload count, and connected browsers. **Live Server logs** retains the most recent 200 entries and omits query strings. Requests support GET and HEAD with MIME types for common web assets. Hidden files, dependency directories, server-side PHP sources, database files, private keys, and symlinks outside the document root are rejected. There is no directory listing or execution of project scripts. Use the native PHP server for PHP applications. Starting requires workspace trust; changing workspaces, restarting the workspace service, or closing the editor stops the preview, closes browser event streams, and releases its port. The status bar shows the active Live Server port. ## Native PHP setup 1. Open your PHP folder and trust it using Workspace Trust. 2. Choose **Check runtimes**. Arya Code searches installed PHP/MySQL tools, common Homebrew and Windows installation paths, and XAMPP/MAMP PHP folders. Set absolute paths through **Runtime setup → Choose installed runtime paths** if needed. 3. **Install PHP tools** downloads checksum-pinned Composer 2.11.1 and phpMyAdmin 5.2.3 into per-user application storage. On Windows x64 it also downloads the official PHP 8.4 ZIP and enables its MySQL extensions; Microsoft's VC++ runtime may be needed. On macOS it installs `php@8.4` through an existing Homebrew installation. If Homebrew is absent, install PHP using the vendor setup link or select an existing XAMPP/MAMP PHP executable. This setup action can run for several minutes and requires internet access. Existing PHP ini files and installations are not rewritten. 4. Install [MySQL Community Server](https://dev.mysql.com/downloads/mysql/) once, or select its existing `mysqld` and `mysql` executables. Arya Code starts its own instance with separate data, rather than controlling system or XAMPP database services. Disable MySQL and phpMyAdmin for PHP-only projects. Managed database initialization requires Oracle MySQL 5.7 or newer; MariaDB data initialization is not implemented. 5. Choose your **Project folder** and **Document root**, relative to the workspace and project respectively. Use `.` for the folder itself, or `public` for Laravel/Symfony. `public/index.php` at the workspace root is detected automatically. 6. Set available ports and click **Start local servers**. Use **Open project** and **Open phpMyAdmin** after startup. Changes to project files are served live. The detected PHP version is displayed under **Detected native tools**. An installed PHP that fails to start is reported separately from a missing executable, with its loader or runtime error. Repair the affected installation or choose a working PHP executable through **Runtime setup**, then check runtimes again. **Install PHP tools** validates macOS PHP even when the other downloads are cached, and reports an error if PHP or Homebrew is unavailable. To switch PHP versions, stop the servers, set `arya.tools.php` to another installed executable, and check runtimes again. PHP needs `mysqli` or `pdo_mysql` for MySQL projects, and `mysqli` for phpMyAdmin. | Tool | Restricted `arya.tools` setting | | --- | --- | | PHP CLI | `php`: absolute executable path | | MySQL server | `mysqld`: absolute Oracle MySQL executable path | | MySQL client | `mysql`: matching client executable path | | Composer | `composer`: absolute Composer PHAR or PHP launcher path | | phpMyAdmin | `phpmyadmin`: extracted directory including `index.php` and `vendor/autoload.php` | | Redis, optional | `redis`: native `redis-server` executable path; a compatible executable must be installed separately, including on Windows | Try the starter with `npm start -- fixtures/php`. For source development, `npm run servers:fetch` prepares Composer/phpMyAdmin and the supported PHP setup in `.tools/servers`. App build/refresh includes that prepared tool pack. PHP on macOS and MySQL remain installed native runtimes; they are not made portable by copying the app. ## Services and database access | Service | Default address | Behavior | | --- | --- | --- | | PHP development server | `http://127.0.0.1:8080` | Native PHP CLI server with static-file serving and front-controller fallback to `index.php` | | MySQL | `127.0.0.1:3307` | Private per-workspace data folder; creates database `arya` and user `arya` | | phpMyAdmin | `http://127.0.0.1:8081` | Native PHP server; cookie login, SQL queries, tables, import/export; 128 MB upload limit | | Redis, optional | `127.0.0.1:6380` | Native process with append-only persistence and loopback binding | The web server uses [PHP's development server and router support](https://www.php.net/manual/en/features.commandline.webserver.php), not Apache. Existing static files are served directly, missing routes go to `index.php`, and dotfiles/path escapes are rejected. Apache `.htaccess` directives are not interpreted. For projects requiring custom Apache modules or rewrite directives, use the project's native Apache/XAMPP/MAMP configuration. These local servers are intended for development. PHP receives `DB_CONNECTION=mysql`, `DB_HOST=127.0.0.1`, `DB_PORT=`, the configured `DB_DATABASE` and `DB_USERNAME` (both default to `arya`), and its saved password. **Copy PHP .env settings** copies these values for frameworks; existing project files are not edited automatically. For phpMyAdmin and external database clients, use the configured database user with **Copy MySQL password**. Use `root` with **Copy root password** for database/user administration. There is no shared default password: each workspace gets randomly generated passwords. Open **Settings → Local servers** to find connection settings and password controls. Stop the servers, edit **Database name**, **Database user**, or service ports in **Connection settings**, then start again to save and apply. Database names support 1–64 letters, numbers, underscores or hyphens; project users support 1–32 letters, numbers, underscores, dots or hyphens. Both start with a letter, number or underscore. For example, `web-passport-administration` and `passport-user` are valid. System databases and accounts are reserved; use **Copy root password** for root administration. Invalid names are caught in the form before submitting. Starting creates the selected database if it is missing, including when the workspace already has initialized MySQL data. New databases use `utf8mb4`. Arya Code configures the project account and verifies that it can connect to the selected database before starting PHP. **Ensure servers running** repeats this database check without starting duplicate processes. A provisioning or access error is reported as a database setup failure. Choosing another database creates or selects it; it does not move or delete tables in the previous database. Previous users are retained. Choose **Change MySQL password** or **Change root password** to set a custom password in masked editor prompts. Use 8–128 characters without whitespace or control characters and confirm the value. Password changes are saved in secure storage and applied on the next start, including for existing databases, without resetting their data. Update your project's `DB_PASSWORD` after changing the user password. Cancelling either prompt leaves the password unchanged. Passwords are random per workspace and saved in the editor's SecretStorage. They are passed through private service IPC and environment variables, never command-line password arguments or webview state. Initial MySQL account setup uses a temporary mode-600 SQL file outside the project, removed after startup or failure. phpMyAdmin uses a private copy and generated configuration, leaving an existing XAMPP/MAMP phpMyAdmin installation untouched. Known password values are redacted from managed process output. Credential copy actions place the requested values on the clipboard. ## Start, stop, logs and Composer **Stop servers** stops only processes started by Arya Code for the current workspace. It asks its MySQL instance to shut down cleanly before process cleanup. Closing the workspace, restarting the backend, exiting Arya Code, or revoking workspace trust also stops its native processes. MySQL and Redis files remain in per-user extension storage for the next start. Changing a database's MySQL major/minor version is refused until it is explicitly migrated. No destructive database reset is provided. **Local servers** refreshes running service health every five seconds. PHP and phpMyAdmin receive an HTTP HEAD probe; database and Redis listeners are checked over TCP. A process that remains alive but stops responding is shown as **unresponsive**, with its PID and uptime. **Ensure servers running** refuses an unresponsive stack and offers the existing logs/stop/start recovery flow. MySQL startup and repeated Start still verify database access with the configured project account. **View server logs** shows bounded output from the current service session. **Composer install** runs the selected native PHP executable with Composer in the project directory; it can run project plugins and scripts and requires trust. Multiple projects can run in separate workspaces when their enabled-service ports differ. Repeated Start reuses a healthy running stack; a partially exited stack must be stopped before retrying. Failed or cancelled startups stop newly launched processes and preserve initialized database files. `npm run check` covers native tool discovery, settings, trust, path containment, occupied ports, process lifecycle, cancellation, duplicate starts, logs, and the webview actions. `npm run test:servers` requires real native PHP, MySQL, Composer and phpMyAdmin. It uses an isolated temporary project to check HTTP, front-controller routing, PDO/mysqli, phpMyAdmin, Composer, duplicate prevention, and database persistence across stop/start, then removes its test-only files. Set `ARYACODE_TEST_WORKBENCH` and run `npm run test:server-ui` for desktop command activation and backend restart. Physical Windows and Intel Mac qualification remain separate from macOS arm64 evidence.