Skip to content

PHP Settings - External HTTP Server

ExeOutput for PHP allows you to configure an external HTTP server to access your PHP application and associated files via a web browser, using URLs such as http://localhost:port.

Why using an HTTP server?

This feature is particularly useful for developers who need to test their PHP applications in a web browser environment, or for those who want to provide a seamless way for users to interact with the application through the end users' web browsers. By setting up an external HTTP server, you can:

  • Access your application and its files directly from any web browser.
  • Allow multiple users to access the application concurrently, depending on your setup.

Info

You can also start and stop the HTTP server programmatically with HEScript. See below.

Configuration Options

External HTTP Server Settings

Here are the different options available for configuring the external HTTP server:

  1. Enable External HTTP Server: Enable this option to allow the use of an external HTTP server.

  2. Server Port: Specify the port on which the external HTTP server will listen.

Warning

Do not enter usual ports such as 80 or 8080, otherwise some antivirus software may consider your application as possible malware.

  1. Allow access to all compiled files: Check this box to allow access to all compiled files (HTML, images, etc.). Otherwise, only PHP scripts will be accepted.

  2. Start and stop the HTTP server automatically: Check this box to start and stop the HTTP server automatically. If not automatic, you can use HEScript to start the HTTP server.

Warning

If the specified port is already in use by another server, an error message "Could not bind the server port" will be displayed. However, the application will not fail and will continue to run as if nothing happened.

Manually Starting and Stopping the HTTP Server

You can start and stop the HTTP server manually using HEScript commands. The following HEScript code demonstrates how to achieve this. Place this code into your UserMain script.

procedure StartMyHTTPServer;
begin
  // Starts the HTTP server on the specified port, here 8142.
  StartHTTPServer(8142);
end;

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

To start the server manually, use the UserMain.StartMyHTTPServer function. To stop the server, use the UserMain.StopMyHTTPServer procedure.