Make sure you have the path set correctly.
include("/path/to/connection.php");
Check permissions on connection.php, check if it is readable
$filename = 'connection.php'; if(is_readable($filename)) { echo 'The file is readable'; } else { echo 'The file is not readable'; }
Is the MySQL database on a single server? AKA Localhost or another server?
Hard code: path
$pwd = `pwd`; echo "PWD: ".$pwd."<br />"; // use just for testing include($pwd."/connection.php");
EDIT: Can you compare connection.php and admin.php
$filename = 'admin.php'; echo "Permissions: ".substr(sprintf("%o",fileperms($filename)),-4)."<br />"; echo "File Owner: ".fileowner($filename)."<br />"; echo "File Group: ".filegroup($filename)."<br />"; if(is_executable($filename)) { echo ("$filename is executable<br />"); } else { echo ("$filename is not executable<br />"); } if(is_readable($filename)) { echo "$filename is readable<br />"; } else { echo "$filename is not readable<br />"; } echo "Real Path: ".realpath($filename)."<br />"; $filename = 'connection.php'; echo "Permissions: ".substr(sprintf("%o",fileperms($filename)),-4)."<br />"; echo "File Owner: ".fileowner($filename)."<br />"; echo "File Group: ".filegroup($filename)."<br />"; if(is_executable($filename)) { echo ("$filename is executable<br />"); } else { echo ("$filename is not executable<br />"); } if(is_readable($filename)) { echo "$filename is readable"; } else { echo "$filename is not readable"; } echo "Real Path: ".realpath($filename)."<br />";
source share