# Create your first PHP site

> Create a site, connect a database, and publish your PHP application from the AppLaunch dashboard.

Create a site, connect a database, and publish your PHP application from the AppLaunch dashboard.

## Before you begin

Make sure:

- You have an active **PHP + MySQL** service on AppLaunch.
- You know which domain or subdomain you want to use.
- Your application files are ready to upload.

## 1. Open your service

Sign in to [AppLaunch](https://applaunch.org/login), open **Dashboard → Services**, and select your PHP + MySQL service.

## 2. Add a domain or subdomain

Open **Domains** and choose the address people will use to visit your website.

To use a free AppLaunch subdomain:

1. Click **Claim Free Subdomain**.
2. Choose an available `*.sites.applaunch.org` address.
3. Follow the setup steps.

To use your own domain or subdomain:

1. Click **Add Domain**.
2. Select **Add External Domain**.
3. Enter the complete hostname, such as `app.example.com`.
4. Add the ownership TXT record shown by AppLaunch.
5. Wait for the record to become public, then click **Verify Ownership**.

> DNS changes may take some time to update, depending on your DNS provider.

For the full ownership and DNS flow, see [Connect an existing domain](/domains/connect-a-domain/).

## 3. Create your site

1. Open **PHP Sites**.
2. Click **Create Site**.
3. Enter a name for your site.
4. Select your domain from the dropdown.
5. Add the A record displayed by AppLaunch at your DNS provider.
6. Click **Verify DNS**.
7. Select the PHP version you want to use. PHP 8.3 is marked as recommended in the dashboard.
8. Click **Create Site**.

When using Cloudflare DNS, set the record's **Proxy Status** to **DNS only** while AppLaunch verifies the address and issues its certificate.

Wait for provisioning to finish. Do not repeatedly create the site while its status is pending.

## 4. Upload your files

Once provisioning is complete, visiting your website should display the default PHP information page.

Open the site, then select **Files**. You can:

- Drag and drop files.
- Create or edit files directly.
- Rename, move, copy, archive, extract, download, or delete entries.
- Use **Access** for SSH and SFTP connection details.

Upload your public entry point as `index.php` inside the document root shown under **Overview → Site Configuration**. See [Manage PHP files and access](/php-mysql/files-and-access/) for detailed instructions.

## 5. Connect a database

Open the site, select **Database**, then:

1. Open **Databases** and create a database.
2. Open **Users** and create a database user. Save an automatically generated password immediately; it may not be shown again.
3. Assign at least one database to the user during creation, or open **Privileges** and grant the required access afterward.

When connecting from PHP hosted on the same AppLaunch site, use the **Internal Host** and **Internal Port** shown under **Database → Connection**. The current platform values are normally:

- **Host:** `mysql`
- **Port:** `3306`

Do not use the external host from code running inside AppLaunch. For connections from your own computer, use the **External Host** and **External Port** shown in **Connection**.

For complete instructions, including users, privileges, password rotation, allowed hosts, phpMyAdmin, and sample PHP code, open [**Advanced → Databases**](/php-mysql/databases/).

## 6. Test your site

1. Visit your domain in a private browser window.
2. Confirm that the application loads over HTTPS.
3. Test features that write to or read from the database, such as signing in, submitting a form, or loading stored data.
4. Open **Logs** if the site returns an error or a blank page.
5. Create a backup before replacing an existing working application.

Once everything works, remove or replace the default PHP information file. A public PHP information page exposes server configuration details that visitors do not need.

Your PHP application is now live.
