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" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Innov8 Internet Test Page - PHP + Server</title>
<?php echo "<xmp>".print_r( $_SERVER, true )."</xmp>"; ?>

<?php echo phpinfo(); ?>

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 *