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

# PHP Hosting Guide

> Learn how to deploy PHP applications on ShardCloud platform.

# Getting Started with PHP Hosting

Deploy your PHP applications on ShardCloud with minimal configuration and maximum performance.

<Info>
  ShardCloud supports PHP applications with automatic dependency management via Composer and built-in web server.
</Info>

## Prerequisites

Before uploading your PHP application, ensure you have the following project structure ready.

<CardGroup cols={2}>
  <Card title="Required Files" icon="circle">
    Essential files for deployment
  </Card>

  <Card title="Optional Files" icon="plus">
    Enhanced functionality files
  </Card>
</CardGroup>

## Required Files

Your PHP application must include these two essential files:

### 1. Entry Point File

* **File**: `index.php` or your main PHP file
* **Purpose**: Main application entry point
* **Requirements**: Must contain your application's main execution code

### 2. ShardCloud Configuration

* **File**: `.shardcloud`
* **Purpose**: Platform-specific deployment settings
* **Requirements**: Plain text configuration file in root directory

<Warning>
  Both files are mandatory. Missing any of these files will prevent successful deployment.
</Warning>

## Optional Files

Enhance your PHP application with these optional configuration files:

### Composer Dependencies (Optional)

* **File**: `composer.json`
* **Purpose**: Defines PHP dependencies and project metadata
* **Benefits**: Automatic dependency installation and autoloading
* **Note**: If present, Composer will automatically install dependencies during deployment

<Note>
  composer.json is optional but recommended for applications using external packages or frameworks.
</Note>

## ShardCloud Configuration

The [.shardcloud](/config) file configures your application deployment settings.

### Configuration Example

```bash theme={null}
DISPLAY_NAME=myfirstphpproject
DESCRIPTION=a simple php application
MAIN=index.php
MEMORY=512
VERSION=LATEST
SUBDOMAIN=php
```

<Note>
  PHP applications have moderate memory requirements. Adjust based on your application's complexity and traffic.
</Note>

## Deployment Process

<Steps>
  <Step title="Prepare Entry Point">
    Ensure your main PHP file is ready and functional
  </Step>

  <Step title="Configure Dependencies">
    Optionally create composer.json for external packages
  </Step>

  <Step title="Configure Platform">
    Create .shardcloud file with deployment settings
  </Step>

  <Step title="Create Archive">
    Zip or RAR your project
  </Step>

  <Step title="Upload via Dashboard">
    Use[ ShardCloud dashboard](https://shardcloud.app/dash) to upload your archive
  </Step>

  <Step title="Deploy & Monitor">
    Application automatically deploys with dependency installation
  </Step>
</Steps>
