# Install

## Install

To install `Php` and `Composer` in the host system.

### Php

{% embed url="<https://www.php.net/downloads.php?os=linux&osvariant=linux-ubuntu&version=8.5>" %}

```bash
# Add the ondrej/php repository.
sudo apt update
sudo apt install -y software-properties-common
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
sudo apt update

# Install PHP.
sudo apt install -y php8.5
```

```bash
php -v
```

### Composer

```bash
# 1. Download the latest composer installer script
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php

# 2. Run the installer and point it globally to your local binaries
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
```

```bash
composer -v
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kdongs.gitbook.io/kdocs/php/install.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
