How I embedded PHP 8.4 runtime directly into Android & iOS apps
说明与用途
Phphone 让 PHP 开发者能够在 Android 和 iOS 上本地运行业务逻辑,使用嵌入式 PHP 8.4 引擎,并通过 AES‑256 加密保护源代码。
问题
Mobile developers typically choose either native code or heavy JS frameworks, limiting the ability to run PHP business logic locally on the device.
结果
Phphone enables PHP developers to run business logic locally on Android and iOS devices, reducing reliance on remote servers, improving performance, and protecting intellectual property through in-memory encryption.
工作流
- 1. Install Phphone CLI and create a new project.
- 2. Write PHP code using Phphone\Device for native hardware access.
- 3. Build the app with
phphone build apk --releaseor equivalent iOS command. - 4. The build process compiles PHP into a native C++/Swift bridge and encrypts source files with AES-256-CBC.
- 5. Deploy the APK/IPA to the device; PHP code is decrypted in RAM and executed by the embedded engine.
- 6. Use local SQLite3 for offline persistence.
- 7. Test the app on Android and iOS devices to verify functionality.
证据
Phphone is an open-source compiler and runtime that packages an embedded PHP 8.4 engine directly into native Android and iOS mobile binaries.
The build process compiles PHP into a native C++/Swift bridge and encrypts source files with AES-256-CBC.
- 记录日期: 2026-09-20T03:45:19.272Z