---
title: PHP Settings – External HTTP Server
description: "ExeOutput for PHP allows you to configure an external HTTP server, enabling access to your PHP application and its files from a web browser using a URL like `http://localhost:port`. ## Why Use an HTTP Server? This feature is useful for…"
url: "https://www.exeoutput.com/help/external-http-server"
updated: "2025-10-01"
category: PHP Settings
---

# PHP Settings – External HTTP Server

ExeOutput for PHP allows you to configure an external HTTP server, enabling access to your PHP application and its files from a web browser using a URL like `http://localhost:port`.

## Why Use an HTTP Server?

This feature is useful for developers who need to test their PHP applications in a browser, or for those who want to let users interact with the application through their own web browsers. It can also allow multiple users to access the application concurrently (depending on your server setup).

Info

You can also start and stop the HTTP server programmatically with HEScript, as explained below.

## Configuration Options

![External HTTP Server Settings](https://www.exeoutput.com/wp-content/uploads/external-http-server-settings.png)

The following options are available for configuring the external HTTP server:

1. **Enable External HTTP Server**: Enables the external HTTP server.
2. **Server Port**: The port on which the external HTTP server will listen.

   Warning

   Do not use common ports like 80 or 8080, as some antivirus software may flag your application as potential malware.
3. **Allow access to all compiled files**: If checked, all compiled files (HTML, images, etc.) will be accessible. Otherwise, only PHP scripts will be served.
4. **Start and stop the HTTP server automatically**: If checked, the HTTP server will start and stop with the application. If unchecked, you must use HEScript to control the server.

Warning

If the specified port is already in use, a "Could not bind the server port" error will be displayed. However, the application will continue to run without the external server.

## Starting and Stopping the Server Manually

You can control the HTTP server manually with HEScript commands. The following code, placed in your [UserMain script](addscript), demonstrates how to do this.

```pascal
procedure StartMyHTTPServer;
begin
  // Starts the HTTP server on the specified port (8142 in this case).
  StartHTTPServer(8142);
end;

procedure StopMyHTTPServer;
begin
  // Stops the HTTP server.
  StopHTTPServer;
end;
```

To start the server manually, call the `UserMain.StartMyHTTPServer` function. To stop it, call the `UserMain.StopMyHTTPServer` procedure.
