My notepad

Chris' IT notes…
← Back

PHP test pages

Basic PHP page

sh
cat > test.php <<EOF
<?php
  echo "<h1>This is a test page</h1>";
?>
EOF

PHPinfo page

sh
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

(command line)

sh
php -r "phpinfo();"

php-fpm/users php page check

sh
cat > test.php <<EOF
<?php
  echo '<br><br>This website is running as: <b>' . exec('/usr/bin/whoami') . '</b>';
  echo '<br><br>From path: <b><i>' . getcwd() . '</i></b><br><br>';
  echo '<br><b><font size="5" color="red">DELETE THIS ONCE TESTED!</font></b>' . "\
";
?>