PHP is a popular scripting language used for web development, automation, and backend tasks. With Termux, you can install PHP directly on your Android phone and run scripts easily without any server setup. Below are the simple installation steps and basic usage commands.
Installation
pkg update && pkg upgrade -ypkg install php -yCheck PHP version:
php --versionCreate a PHP file:
nano test.phpAdd this code:
<?php
echo "Hello Termux!";
?>Run the file:
php test.phpUsage Commands
Run any PHP script:
php filename.phpStart a local PHP server (port 8080):
php -S localhost:8080Show PHP help:
php --helpList PHP modules:
php -mUninstall PHP:
pkg uninstall php