# Hello World app in PHP

Now that Docker is installed, lets create a small hello world application using PHP. We don't need PHP installed on the local machine to test and develop the application. All dependencies such as the PHP language, and an HTTP server will be managed inside the Docker container.

### Creating a PHP project

First we need a directory that will contain the project files. So lets start by creating an empty directory called `docker-hello-world-php`. Then, in this directory we can create a file called `index.php` and provide it with the following code:

```php
<?php

echo "Hello world!";
```

This is a minimal PHP  script that will show the text `Hello World!` in the browser.

#### Optional: Testing out our Hello World application

If you have PHP installed on your computer, you are able to test the application by running the following command in your command line.&#x20;

```bash
$ php -S localhost:3000
```

When surfing to[ http://localhost:3000](http://localhost:3000) in the brower you will be able to view the result if all goes well.

![Hello World application in the browser](https://3155969731-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAse2WvJYHuIEXpYSUk%2F-LB1z_v6Qh8CANVApgNa%2F-LB22RMHfatO3i6XMsih%2Fphp-hello-world-browser.png?alt=media\&token=e5e3d653-61ab-44cf-a17a-5cdaa59b665e)

Now that we have confirmation that our script is working, lets continue and try to get everything in a Docker container.


---

# 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://vives.gitbook.io/docker/hello-world-app-in-php.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.
