Download the PHP package omaralalwi/php-py without Composer
On this page you can find all versions of the php package omaralalwi/php-py. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download omaralalwi/php-py
More information about omaralalwi/php-py
Files in omaralalwi/php-py
Package php-py
Short Description play with python in PHP applications
License MIT
Homepage https://github.com/omaralalwi/php-py
Informations about the package php-py
PhpPy - PHP Python ๐๐
Seamlessly enabling secure and efficient execution of Python scripts within PHP applications without spread multiple applications and or setup API.
๐ Laravel py package
๐ Table of Contents
- ๐ Overview
- ๐ง Requirements
- ๐ Installation
- ๐ Quick Start
- โจ Features
- ๐ Framework Integration
- ๐ Changelog
- ๐งช Testing
- ๐ Security
- ๐ค Contributors
- ๐ License
๐ Overview
The PhpPy
package provides seamless integration between PHP and Python without API, enabling secure and efficient execution of Python scripts within PHP applications. It ensures structured script execution while managing configurations, arguments, environment variables, and error handling.
Requirements
- PHP 8.1+
- python3 must be installed in server .
Installation ๐ ๏ธ
You can install the package via Composer:
๐ Quick Start
- ๐ Create a folder for scripts, e.g.,
phpPyScripts
in your project root directory. - ๐ Create a Python script file (
.py
extension) and write Python code. See this script examples. - ๐ง make script file executable,
chmod +x script_file_path
.
โก Easy Usage
๐ฅ Advanced Usage
๐ Real-World Example
Example: Running DeepSeek AI on your server while handling API requests using PHP.
โจ Features
๐ Secure Execution
- Path Validation โ Ensures scripts are within allowed directories.
- Argument & Environment Validation ๐ Restricts unauthorized input.
- Timeout Control โณ Prevents long-running scripts.
- black list for these vars
PATH,PYTHONPATH,LD_LIBRARY_PATH,LD_PRELOAD,PYTHONHOME
, can not passed . - Uses
proc_open
as an alternative toshell_exec
.
๐ง Flexible Configuration
- Centralized settings via
ConfigManager
. - Customizable execution parameters.
๐ค Output Handling
- Supports JSON parsing.
- Captures and reports script errors.
๐จ Error Management
- Detailed exception handling for debugging.
- Standardized error reporting.
๐ Extensibility
- Modular execution through
CommandExecutor
. - Customizable for advanced use cases.
Important Critical Note:
โ Never pass user-controlled input directly script, just pass scripts that you will need as a administrator (Just from Your side) .
๐ Changelog
See detailed release notes in CHANGELOG.md ๐
๐งช Testing
๐ Security
Report Vulnerabilities: Contact [email protected] ๐ฉ
๐ค Contributors
A huge thank you to these amazing people who have contributed to this project! ๐๐
Omar AlAlwi ๐ Creator |
Want to contribute? Check out the contributing guidelines and submit a pull request! ๐
๐ License
This package is open-source software licensed under the MIT License. ๐