php
PHP command-line interpreter
TLDR
SYNOPSIS
php [options] [-f] [file] [args]
DESCRIPTION
php is the command-line interface to the PHP interpreter. It can execute PHP scripts, run inline code, lint files for syntax errors, and start a built-in development web server. PHP supports procedural, object-oriented, and functional programming paradigms.
The built-in web server (`-S`) is intended for development only and should not be used in production. It serves files from the current directory or a specified document root.
PARAMETERS
FILE
PHP script to execute.-r CODE
Execute PHP code without script tags.-S ADDR:PORT
Start the built-in development web server.-t DOCROOT
Document root for the built-in web server.-a
Run interactively (REPL mode).-l
Syntax check only (lint), does not execute.-i
Output phpinfo() configuration details.-m
Show compiled-in modules.-v
Show version information.-c PATH
Use a specific php.ini file or directory.-n
Run without a php.ini file.-d DIRECTIVE=VALUE
Set a php.ini directive at runtime.-e
Generate extended information for debuggers/profilers.-f FILE
Parse and execute the given file (explicit form).-w
Output source with comments and whitespace stripped.-B CODE
Run code before processing stdin (with -R/-F).-R CODE
Run code for every input line from stdin.-F FILE
Parse and execute file for every input line from stdin.
CAVEATS
Configuration is controlled by php.ini; the loaded file location varies by system (use `php --ini` to find it). Extension availability depends on compile-time options and installed packages. The built-in web server is single-threaded and not suitable for production use.
HISTORY
PHP was created by Rasmus Lerdorf in 1994, originally as a set of CGI binaries for tracking visits to his web resume. It evolved into a full server-side scripting language. PHP 5 introduced a mature object model, and PHP 7 (2015) brought major performance improvements. PHP 8 (2020) added JIT compilation, named arguments, and attributes.
SEE ALSO
composer(1), phpunit(1), pecl(1), php-cs-fixer(1)

