Using phpinfo and print_r $_SERVER

Using phpinfo and print_r $_SERVER

Some times when developing on a server you arent familiar with you need to know the PHP configuration of the web server.

This can be easily achieved by using the below script saved as a .php file and called in a web browser.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Innov8 Internet Test Page - PHP + Server</title>
</head>
<body>
<?php echo "<xmp>".print_r( $_SERVER, true )."</xmp>"; ?>


<?php echo phpinfo(); ?>
</body>
</html>

The above script also includes the print_r( $_SERVER, true ) command which details details returned in the webpage response header.

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *