Principled Technologies, Inc. 25 
 
Dell PowerEdge C6220 and CentOS 6.2: A LAMP Reference 
Architecture
 
APPENDIX D – SAMPLE SCRIPT FILE FOR LAMP ON CENTOS 6.2 
Figure 3 presents the sample PHP file to use for testing the LAMP stack. 
<?php 
$db_username="testappuser"; 
$db_password="Password1"; 
$db_host    ="localhost"; 
$db_name    ="helloworlddb"; 
$link       = mysql_connect($db_host, $db_username, $db_password); 
mysql_select_db($db_name, $link); 
$result = mysql_query("SELECT testcol FROM tbl_hello_world", $link); 
$row    = mysql_fetch_assoc($result); 
print_r($row); 
mysql_close($link); 
?> 
Figure 3: Sample PHP file to query the test database: /var/www/html/helloworld.php.