php / php/php-src

Add an optional parameter to phpinfo() for html output in CLI SAPI

Open
#10,040 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: standard Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Every time exist more CLI app frameworks: amp, react, workerman, ...

And phpinfo(int $what = INFO_ALL): bool allways return an string output without HTML.
Every framework can create an html output, but I think that will be better return the same than in other SAPIs.
Now it's hardcoded in the C code the output.

Please add another parameter $html

phpinfo(int $what = INFO_ALL, $html = true): bool
Or add a option in php.ini, phpinfo.html=false , perhaps it's easier. By default for CLI will be false.
But will be changed easily for any CLI framework.

Thank you !!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the CLI SAPI's hardcoded phpinfo output in the C code and compare it with the HTML output produced by other SAPIs. Decide whether the behavior should use an optional parameter or a php.ini setting, then verify that CLI callers can request HTML while the existing default remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.