定制 dconco/phantom-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dconco/phantom-php

Composer 安装命令:

composer require dconco/phantom-php

包简介

A PHP android web server for the Acode app, allowing you to serve your PHP applications both locally and share them online. It boasts fast performance and high reliability.

README 文档

README

Version License

PhantomPHP Server Screenshot

Table of Contents

Overview

PhantomPHP is a PHP web server for Android, designed for use with the Acode app, enabling you to run and share PHP and MySQL applications from your device. It’s built to provide fast performance, high reliability, and easy integration with MySQL databases for powerful, dynamic web development.

Key Features

  • PHP Serving: Run PHP files directly from Acode.
  • Port Forwarding: Share your local server with others securely.
  • Direct PHP File Execution: Execute files without additional configuration.
  • Seamless Fast Auto Installation Integration: Quick automatic setup, you don't have to do much.
  • MySQLi and phpMyAdmin Support: Manage databases with ease.
  • Custom Port Selection: Choose your preferred port.
  • User-Friendly Interface: Optimized for ease of use.

Installing PhantomPHP

To install PhantomPHP on your Android device, you’ll need the following prerequisites:

Installation Requirements

  1. Termux:
    A powerful Linux terminal emulator for Android, available on F-Droid and GitHub.
    This will allow you to run a Linux environment on your Android device.

  2. Acode:
    A code editor for Android, available on the Google Play Store.
    Ideal for editing and writing your code directly on your Android device.

  3. PHP (version 7.4 or above):
    Installable via Termux.
    PHP is required for running server-side scripts and applications.

  4. Composer:
    A PHP package manager used for handling dependencies and libraries in PHP projects.
    You can install Composer in Termux to manage PHP packages.

  5. MariaDB:
    A popular open-source database management system, forked from MySQL.
    Required for managing databases in your projects.

  6. phpMyAdmin:
    A web-based tool for managing MySQL and MariaDB databases.
    It provides an easy-to-use interface for database administration.

Installation Steps

  1. Install Termux:

  2. Install Acode:

  3. Install Composer:

    • Open Termux and run the following commands to install Composer:
    pkg update
    pkg upgrade
    pkg install php
    pkg install curl
    curl -sS https://getcomposer.org/installer | php -- --install-dir=/data/data/com.termux/files/usr/bin --filename=composer

    This will install Composer globally in Termux.

  4. Run Auto Installation Command:

    • Once Composer is installed, copy and paste the following commands to automatically install and configure the required dependencies:
    composer global require dconco/phantom-php
    echo export PATH="$PATH:~/.composer/vendor/bin" >> ~/.profile
    phantom --install
    phantom -v
  5. Access phpMyAdmin:

    • Use the phantom command to start the PHP server for phpMyAdmin access. Replace <port> with the desired port number (e.g., 8080):
    phantom --db <port>

Now, you should be able to access phpMyAdmin through your browser by navigating to http://localhost:<port>.

Testing

To test your setup, navigate to your project directory and run the following command:

phantom -v

Usage

Basic Usage Outline for PhantomPHP Server

Serving

This is the basic way to serve your PHP project. It will run a local server with the default port 8000.

example:

cd /path/to/your-project-directory
phantom --serve

Port Selection

In case the default port 8000 is already in use, you can change the port by using the -p option followed by your desired port number (e.g., 8080).

example

phantom --serve 8080

This will run the local server on the selected port.

phpMyAdmin Initialization

To start both MySQL and phpMyAdmin for database interaction, you can specify a custom port with the -D flag. In this example, we use port 8880. If a port is already in use, the server will not run.

example

phantom --db 8880

Port Forwarding

Want to share your work with your team or friends? PhantomPHP allows you to forward your local server port and share it with others, including SSL certification for a secure connection. Use the -f flag to enable port forwarding.

example

phantom -serve 8080 -f 
#or use --forward

This will run the local server on port 8080 and forward the port for others to access.

Direct File Running in PHP

To quickly run your PHP file and get immediate output, you can use the following command without needing to add the .php extension. Simply provide the filename.

Usage Example:

phantom -run filename

For instance:

phantom --run init

This will run the init.php file.

Need Further Help?

If you're still having trouble, you can contact the repository owner or contributors for assistance. You can also email your issue to:

Email: uoladele99@gmail.com, concodave@gmail.com

For additional command options, you can view the help menu with:

phantom --help

Contributing

We welcome contributions! If you'd like to improve or fix something, please open an issue to start a discussion. Once your idea is approved, feel free to submit a pull request.

License

This project is licensed under the **MIT License**, which allows you to freely use, modify, and distribute the code. See the `LICENSE` file for full details.

Leave a Star ⭐

If you find PhantomPHP Server useful, please consider leaving a star on the repository! Your support helps others discover the project and motivates us to keep improving it.

dconco/phantom-php 适用场景与选型建议

dconco/phantom-php 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 69 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Phantom」 「phantom-php」 「PhantomPHP」 「acode-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 dconco/phantom-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dconco/phantom-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 dconco/phantom-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 69
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-14