Skip to content

[FEATURE] Support PHP language installation. #3

Description

@cryptomafiaPB

Description

Add official support for PHP so that users can install and execute PHP scripts using CHADBOX, alongside other supported languages. This involves updating the manifest registry, ensuring proper security, testing functionality, and documenting the process for the community.

Problem Statement

Currently, CHADBOX supports a variety of interpreted and compiled languages (Python, Node.js, Rust, Go, Java, etc.), but lacks PHP, which is widely used for web applications, education, and scripting. Adding PHP support will expand the use cases for CHADBOX and attract a broader developer base.

Proposed Solution

  1. Add PHP entry to manifest.json — Update packages/cli/src/registry/manifest.json with PHP version(s), download URL, SHA256 checksum, and run commands (following the pattern used for Python, Node.js, etc.)

  2. Setup PHP extraction and environment — Configure extraction folder, environment variables (if needed), and any PHP-specific runtime settings

  3. Test the pipeline — Verify installation and execution:

    • chad install php

    Test php using /api/v1/execute API endpoint OR run benchmark command
    to run PHP benchmark test update the benchmark.ts, Update the PAYLOAD array to include PHP code

    • chad benchmark -c 1 -n 5 php
  4. Update documentation — Add PHP to supported languages list in README and CLI help

Example Usage

This is pure example structure not exact solution
manifest.json entry:

"php": {
    "name": "PHP",
    "default_version": "8.2.13",
    "versions": {
        "8.2.13": {
            "url": "https://www.php.net/distributions/php-8.2.13.tar.gz",
            "sha256": "[verify-and-add-actual-sha256]",
            "extractFolder": "php-8.2.13",
            "compile_cmd": null,
            "run_cmd": ["/opt/php/bin/php", "{files}"]
        }
    }
}

CLI Usage:

# Install PHP
chad install php

# Execute PHP code (benchmark.ts file need to be updated for supporting PHP payload)
chad benchmark -c 1 -n 5 php

# Or test using API endpoint

Additional Context

  • Reference implementations: See how Python 3.10.13, Node.js 24.16.0, and Ruby 3.3.0 are configured in manifest.json for patterns
  • Recommended PHP versions: 8.2.x (current stable) and optionally 8.1.x (LTS)
  • Security: Always verify SHA256 checksums of downloaded binaries
  • Good first issue — Perfect for new contributors to learn the CHADBOX language addition workflow
  • Related PRs: Refer to similar language addition commits for reference
  • Testing: Test implementation install and execution of PHP before merging

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions