PHP Desktop Documentation

repository·master·Indexed 25 days ago

https://github.com/cztomczak/phpdesktop

An open-source project for creating native desktop GUI applications using PHP, HTML5, JavaScript, and SQLite. It embeds a web browser (Chrome/Chromium or Internet Explorer), a Mongoose web server, and a PHP interpreter into a single portable application, supporting frameworks like Laravel, Symfony, and CakePHP.

Tokens
729
Snippets
1
Records
4
Agent score
34%

What's inside PHP Desktop

  1. Overview of PHP Desktop

    master

    PHP Desktop is a tool that allows you to create native desktop applications using PHP, similar to how Electron works for JavaScript. It embeds a Chrome browser engine, a multi-threaded web server (Mongoose), and a PHP interpreter into a single application.

    Key features include:

    • Web-to-Desktop Conversion: Convert existing web applications (like WordPress, Drupal, or Joomla) into standalone desktop applications.
    • Portability: Distributed as a single portable ZIP folder that works "out of the box" without requiring a pre-installed web server, PHP, or Chrome.
    • Local Data Access: Applications run locally, providing direct access to the user's file system and other running programs.
    • Chromium-based: Uses Chromium technology (HTML5/JS) for easy integration of web technologies.
  2. Download PHP Desktop binaries

    master

    PHP Desktop is available for Windows, Mac, and Linux. Choose the version that matches your target platform. The Chrome-embedded versions are recommended as they have no external dependencies and work out of the box.

    Available Releases:

    • Windows: PHP Desktop Chrome 130.1
    • Mac: PHP Desktop Chrome 130.1
    • Linux: PHP Desktop Chrome 72.1
    https://github.com/cztomczak/phpdesktop/releases
  3. Database integration with PHP Desktop

    master

    While PHP Desktop is designed for portability, you must choose a database strategy that fits your distribution model:

    • SQLite (Recommended): Best for portability as it does not require installation as a service on the end-user's computer. Most PHP applications (WordPress, Drupal, etc.) support switching from MySQL to SQLite.
    • PostgreSQL: A portable version of PostgreSQL can be integrated by creating an application installer (e.g., using Inno Setup) or using Windows scripts (bat, wscript, etc.).
    • MySQL: Using MySQL is possible but carries licensing restrictions. Its license may not allow you to distribute the database directly bundled with your own programs for commercial use. Instead, you may need to provide the user with a MySQL installer and instruct them to install it separately.
  4. Convert a PHP web application to a desktop application

    master

    PHP Desktop allows you to turn existing PHP web applications or CLI tools into native desktop GUI applications using web technologies (PHP, HTML5, JavaScript, and SQLite).

    To convert an existing website into a desktop application, copy your project files into the phpdesktop/www/ directory of the downloaded PHP Desktop package.

    Key features:

    • No new API required: Use your existing web development workflow.
    • Embedded components: Includes a web browser (Chrome/Chromium or Internet Explorer), a multi-threaded Mongoose web server, and a PHP interpreter.
    • Framework Support: Supports popular frameworks including CakePHP, CodeIgniter, Laravel, Symfony, Yii, and Zend Framework.
    • Portability: The package is a portable folder that can be distributed as a ZIP archive or via an installer (e.g., Inno Setup).