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
sudo apt install php-defaultsFlags
Examples
php.default -hphp-cgi.default -hphar.default versionphpdismod -hphpenmod -hphpquery -hphp-config.default --versionphpize.default --help