Skip to content

Instantly share code, notes, and snippets.

@divinity76
Last active July 5, 2023 05:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save divinity76/265e8b4584c928abc39e8cf254ed1fbc to your computer and use it in GitHub Desktop.
Save divinity76/265e8b4584c928abc39e8cf254ed1fbc to your computer and use it in GitHub Desktop.
phpinfo.php
<?php
declare(strict_types=1);
error_reporting(~0);
ini_set("display_errors", "1");
phpinfo(~0);
$data = ["_POST" => $_POST, "_GET" => $_GET, "_COOKIE" => $_COOKIE, "_REQUEST" => $_REQUEST, "_SERVER" => $_SERVER, "php://input" => file_get_contents("php://input")];
if(defined("STDIN")){
stream_set_blocking(STDIN, false);
$data["stdin"] = stream_get_contents(STDIN);
}
if (is_callable("apache_get_modules")) {
$data["apache_get_modules"] = apache_get_modules();
} else {
$data["apache_get_modules"] = "N/A (not callable)";
}
$data["headers_list"] = headers_list();
foreach ($data as $name => $val) {
vd($name, $val);
echo "<br/>\n";
}
function vd()
{
if (is_callable('xdebug_var_dump')) {
call_user_func_array('xdebug_var_dump', func_get_args());
} else {
echo '<pre>';
call_user_func_array('var_dump', func_get_args());
echo '</pre>';
}
}
@divinity76
Copy link
Author

lazypasta:

wget 'https://gist.githubusercontent.com/divinity76/265e8b4584c928abc39e8cf254ed1fbc/raw/phpinfo.php' -O phpinfo.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment