Web Application Analysisphpwebscriptingapachefpmclimodulesdevelopment

PHP Defaults

PHP Defaults provides metapackages and binaries for the latest stable PHP version (8.4) in Kali Linux, including Apache modules, CLI interpreters, FPM, and extension modules for web development and scripting.

Description

PHP Defaults is a collection of metapackages that depend on PHP 8.4, serving as entry points for installing the default PHP interpreter, Apache module, CGI/FPM binaries, and various extensions like curl, gd, json, mysql, and xml. These packages enable server-side HTML-embedded scripting for web development, CLI scripting, and embedding PHP in applications. Common utilities like phpdismod, phpenmod, and phpquery manage PHP versions and modules.

Use cases include setting up PHP web servers with Apache or FPM, developing and testing PHP scripts from the command line, building PHP extensions with phpize and php-config, and managing PHAR archives for application distribution. It's essential for web application testing, debugging with phpdbg, and handling tasks like command injection or input validation in penetration testing.

The packages avoid hardcoded dependencies on specific PHP versions, pulling in the latest stable release automatically. This simplifies installation for cybersecurity tools requiring PHP, such as web vulnerability exploitation or analysis.

How It Works

PHP Defaults metapackages resolve to PHP 8.4 binaries and libraries (e.g., libapache2-mod-php8.4 for Apache integration via mod_php, php8.4-fpm for FastCGI Process Manager daemon). CLI tools like php.default execute scripts with options for interactive mode (-a), direct code (-r), or server mode (-S). PHAR tools (phar.default) create/compress/extract self-contained PHP archives using compression (gz, bz2) and hashing (SHA256, OpenSSL). Module management uses phpenmod/phpdismod to enable/disable extensions per SAPI (CLI, FPM, Apache). Configuration queries via php-config.default output compile flags, includes, and libs for building extensions with phpize.default.

Installation

bash
sudo apt install php-defaults

Flags

-aRun as interactive shell (requires readline extension) for php.default
-f <file>Parse and execute <file> for php.default
-r <code>Run PHP <code> without using script tags for php.default
-S <addr>:<port>Start built-in web server for php.default
-nNo configuration (ini) files will be used for php.default
-f fileSpecifies the phar file to work on for phar.default add command
-c algoCompression algorithm for phar.default add command
--prefixShow PHP prefix for php-config.default
-v ALL|php_versionSpecify PHP version for phpdismod and phpenmod

Examples

Show usage and options for the default PHP CLI interpreter
php.default -h
Display help for PHP CGI binary usage and flags
php-cgi.default -h
Get PHAR tool version information
phar.default version
Show usage for disabling PHP modules
phpdismod -h
Show usage for enabling PHP modules
phpenmod -h
Display help for querying PHP versions and modules
phpquery -h
Show PHP configuration version
php-config.default --version
Get help for preparing PHP extensions for compiling
phpize.default --help
Updated 2026-04-16kali.org ↗