> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withnubo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP

> Ship a PHP app to Nubo

PHP isn't covered by [Raypacks](/raypacks/overview) yet, so PHP Frames use the classic Paketo builder. Switch the Frame's **Builder** to **Paketo** in **Frame Settings** if it's not already.

What Paketo needs from you:

1. A `project.toml` that sets a web root and a port.
2. PHP source files (and optionally a `composer.json`).

## Quick start

```bash theme={null}
mkdir hello-php && cd hello-php
mkdir htdocs
```

`htdocs/index.php`:

```php htdocs/index.php theme={null}
<?php
echo "Hello from PHP on Nubo!";
```

`project.toml` at the repo root:

```toml project.toml theme={null}
[project]
id = "php-starter"
name = "PHP Starter"
version = "1.0.0"

[[build.env]]
name = "BP_PHP_WEB_DIR"
value = "htdocs"

[[build.env]]
name = "PORT"
value = "8080"
```

`BP_PHP_WEB_DIR` is the folder that holds `index.php`. `PORT` sets the port PHP's web server listens on. The Frame's port setting should match.

## Deploy

<Steps>
  <Step title="Push to GitHub">
    Commit and push.
  </Step>

  <Step title="New Frame on Nubo">
    Hit **+ Frame**, connect the repo.
  </Step>

  <Step title="Confirm the port">
    Match what `PORT` is set to (8080 here).
  </Step>

  <Step title="Deploy">
    Paketo installs Composer deps if you have a `composer.json`, then starts PHP's web server.
  </Step>
</Steps>

## Pinning a PHP version

```toml project.toml theme={null}
[[build.env]]
name = "BP_PHP_VERSION"
value = "8.3.*"
```

## Composer

If your repo has a `composer.json`, dependencies are installed automatically. Commit your `composer.lock` for reproducible builds.

## Raypacks support

PHP is on the Raypacks roadmap. We'll add a PHP pack once we've nailed the simple-deployment story. For now, Paketo is the path.
