= PHP = The '''PHP programming language''' (PHP standing for '''PHP: Hypertext Preprocessor''') is an interpretted language designed for dynamic web pages. The interpretter is called with '''`php(1)`'''. The current version is 8, but older (unsupported) versions see continued use. The language has evolved rapidly and porting between versions can be a difficult task. <> ---- == Example == {{{ PHP "Hello, World!" program Hello, World!

'; ?> }}} ---- == Installation == Most [[Linux]] and [[BSD]] distributions offer a `php` package, as well as versioned packages (like `php7`). ---- == Configuration == See [[PHP/Configuration|here]] for details. === Logging PHP === To log a `php(1)` process, configure `/etc/php/php.ini` with: {{{ display_errors = off log_errors = on error_log = "/var/log/php.log" }}} Some notable settings and their default values: * `log_errors_max_len` defaults to `1024`; set to `0` for no limit * setting `ignore_repeated_errors` to `1` will suppress repeated log messages * setting `ignore_repeated_source` to `1` ''while'' `ignore_repeated_errors` is also `1` will suppress repeated log messages from different sources === Logging PHP-FPM === To log a `pgp-fpm(8)` pool, configure `/etc/php/php.fpm.d/$pool.conf` with: {{{ [www] access.format = "[%t] %m %{REQUEST_SCHEME}e://%{HTTP_HOST}e%{REQUEST_URI}e %f%Q%q (status=%s)" access.log = /usr/local/var/log/$pool.log }}} Note that `log_level` is set in `php-fpm.conf`. {{{ log_level = debug }}} To log `php(1)` processes differently for each `php-fpm(8)` pool, try: {{{ [www] php_admin_flag[log_errors] = on php_admin_value[error_log] = /var/log/php-$pool.log }}} ---- == Applications and Servers == * [[PHP/FPM|PHP-FPM]] * [[PHP/Nextcloud|Nextcloud]] * [[PHP/PhpMyAdmin|phpMyAdmin]] * [[PHP/RainLoop|RainLoop]] ---- == See also == [[https://www.php.net/manual/en/|PHP Manual]], the language reference manual [[https://man.archlinux.org/man/php.1|php(1)]] ---- CategoryRicottone