# PHP quickstart

> Get started quickly with the Fern PHP SDK.

Generate a PHP SDK by following the instructions on this page.

<Info>
  This page assumes that you have:

  * An initialized `fern` folder. See [Set up the `fern`
    folder](/sdks/overview/quickstart).
  * A GitHub repository for your SDK. See [Project Structure](/sdks/overview/project-structure).
</Info>

<Steps>
  ### Pass `fern check`

  Run `fern check` to ensure that your API definition is valid. If there are any errors,
  fix them before proceeding.

  <Note>
    If you're using an OpenAPI Specification, check out all of our
    [supported extensions](/learn/api-definition/openapi/extensions).
  </Note>

  ### Add the SDK generator

  Run the following command to add the PHP SDK generator to `generators.yml`:

  ```bash
  fern add fern-php-sdk --group php-sdk
  ```

  <Note>
    `php-sdk` is the name of the `generators.yml` group that configures your PHP
    SDK's output location and other metadata. You can customize this group name to
    differentiate between multiple SDKs across different languages (e.g.,
    `ruby-sdk`, etc) in your organization.
  </Note>

  This command adds the following `group` to `generators.yml`:

  ```yaml title="generators.yml"
    php-sdk: # group name
      generators:
        - name: fernapi/fern-php-sdk
          version: 1.25.3
          output:
            location: local-file-system
            path: ../sdks/php/sdk
  ```

  ### Generate the SDK

  Run the following command to generate your SDK:

  ```bash
  fern generate --group php-sdk
  ```

  <Note>
    If you have multiple APIs, use the [`--api` flag](/cli-api-reference/cli-reference/commands#api) to specify the API you want to generate:

    ```bash
    fern generate --group php-sdk --api your-api-name
    ```
  </Note>

  This creates a `sdks` folder in your current directory. The resulting folder structure looks like this:

  <Files>
    <Folder name="fern" comment="created by fern init" />

    <Folder name="sdks" defaultOpen comment="created by fern generate --group php-sdk">
      <Folder name="php" defaultOpen>
        <Folder name="sdk" defaultOpen>
          <Folder name="src" defaultOpen>
            <File name="YourOrganizationClient.php" />

            <Folder name="Types" />
          </Folder>

          <Folder name="tests" defaultOpen>
            <Folder name="Core" />
          </Folder>
        </Folder>
      </Folder>
    </Folder>
  </Files>
</Steps>