Introduction

What is ExoPHP?

ExoPHP is a cross-platform desktop application framework designed specifically for PHP developers. It enables you to build native desktop applications for Windows, Linux, and other supported platforms using PHP as the backend language and modern web technologies for the user interface.

Developers can use any frontend framework that compiles to HTML, CSS, and JavaScript, including plain HTML/CSS/JavaScript, React, Vue, Angular, and others. ExoPHP combines the simplicity of web development with the power of desktop applications, allowing PHP developers to create fast, lightweight, and secure desktop software.


Installation

Downloading ExoPHP

Download the appropriate installer for your operating system from the ExoPHP homepage:

  • Windows: .exe
  • Debian/Ubuntu: .deb
  • Fedora/RHEL: .rpm

After installation, the exophpcommand will be available from your terminal.


Creating Your First Application

Initialize a new ExoPHP project:

Terminal
$ exophp create MyApp

This command creates a new project directory containing the default application template.


Development Workflow

Running the Application

Start the application in development mode:

Terminal
$ exophp run

ExoPHP will launch your application and automatically start the embedded PHP server.

Building the Application

Package your application for distribution:

Terminal
$ exophp build

The generated package is built for your current operating system and is ready for distribution.


Project Structure

A newly created project contains the following files and directories:

Directory Structure
MyApp/
├── app.json
├── index.php
├── script.js
├── style.css
├── icon.png
└── bin/
    └── php

The provided files serve as a starter template and can be modified or replaced with your own application code.


Configuration

Application settings are stored in the app.json file.

Example:

app.json
{
    "title": "My ExoPHP App",
    "description": "A professional desktop application built with ExoPHP",
    "version": "1.0.0",
    "icon": "icon.png",
    "window": {
        "width": 1000,
        "height": 800,
        "resizable": true
    },
    "php": {
        "port": null,
        "bin": "bin/php"
    }
}

Configuration Options

Application Information

PropertyDescription
titleApplication title displayed in the window title bar.
descriptionShort description of the application.
versionApplication version number.
iconApplication icon file.

Window Settings

PropertyDescription
widthInitial window width.
heightInitial window height.
resizableAllows users to resize the application window.

PHP Settings

PropertyDescription
binPath to the bundled PHP executable.
portServer port used by the embedded PHP server.

If port is set to null, ExoPHP automatically selects an available port at runtime. Alternatively, you can specify a fixed port number.


Bundled PHP Runtime

Every ExoPHP project includes its own PHP runtime located inside the bin directory:

Path
bin/php

This allows applications to run independently without requiring PHP to be installed on the target system.


Working with Databases and Resources

Applications built with ExoPHP create temporary runtime files during execution. These files are automatically generated when the application starts and are removed when the application exits.

If your application uses a database or other files that must persist between sessions, do not store them in the temporary runtime directory. Any files placed in the runtime directory will be deleted when the application closes.

Instead, store databases and other persistent resources inside your application's bin directory and reference them using the appropriate file paths.

Linux Installation

On Linux, installed applications are typically located at:

Path
/opt/<application-name>

When developing your application, ensure that database connections and resource paths point to files within the bin directory. This ensures that required resources remain available after installation and are not affected by the temporary runtime cleanup process.

Example

Recommended:

Example Paths
/opt/myapp/bin/database.db
/opt/myapp/bin/user-data.json
/opt/myapp/bin/settings.ini
/opt/myapp/bin/app-data.sqlite

Security and Code Protection

When building an application, ExoPHP automatically applies code protection mechanisms to help safeguard your source code.

PHP Protection

PHP source code is protected using:

  • YAK Pro - PHP Obfuscator

Frontend Protection

Developers have full control to optimize their frontend assets:

  • Minify JS & CSS code
  • Obfuscate custom script files

Since frontend asset compilation is handled by your framework of choice, these optimizations can be performed during your frontend build process before packaging with ExoPHP.


Frontend Framework Support

ExoPHP supports any frontend technology that produces standard web assets:

HTML
CSS
JavaScript
React
Vue
Angular
Svelte
Bootstrap
Tailwind CSS

This flexibility allows developers to use their preferred frontend stack while leveraging PHP for backend application logic.


CLI Reference

ExoPHP provides a simple command-line interface (CLI) for creating, developing, building, and managing applications.

Create a New Project

Create a new ExoPHP application:

Terminal
$ exophp create <AppName>

Example:

Terminal
$ exophp create MyApp

Run in Development Mode

Launch the application in development mode:

Terminal
$ exophp run

Build for Distribution

Package the application for the current operating system:

Terminal
$ exophp build

Display Version Information

Display the currently installed ExoPHP version:

Terminal
$ exophp --version

or

Terminal
$ exophp -v

Display Help Information

Show all available commands and options:

Terminal
$ exophp --help

or

Terminal
$ exophp -h

Command Summary

CommandDescription
exophp create <AppName>Create a new ExoPHP project.
exophp runRun the application in development mode.
exophp buildBuild and package the application.
exophp --versionDisplay the installed ExoPHP version.
exophp -vShort form of --version.
exophp --helpDisplay help information.
exophp -hShort form of --help.