I have a problem with ExpressionEngine2 after moving from an old server to WHM/cPanel. Simple test code to reproduce that issue (childrensmedgroup2.com/test/):
Where header.html looks like
and footer.html looks like:
Creates Apache time out:
Same problem when I use file_get_contents() instead include().
Any clue what can be wrong with Apache or PHP configuration?
Thanks
PHP:
<?php
$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';
$host = $_SERVER['HTTP_HOST'];
include($protocol . '://' . $host . '/header.html');
?>
<p> Main text...</p>
<?php
include($protocol . '://' . $host . '/footer.html');
?>
Code:
<!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>Untitled Document</title>
</head>
<body>
and footer.html looks like:
Code:
</body>
</html>
Code:
Quote:
Warning: include(http://www.domain.com/header.html) [function.include]: failed to open stream: Connection timed out in /home/domain/public_html/test/index.php on line 5
Warning: include() [function.include]: Failed opening 'http://www.domain.com/header.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/domain/public_html/test/index.php on line 5
Main text...
Warning: include(http://www.domain.com/footer.html) [function.include]: failed to open stream: Connection timed out in /home/domain/public_html/test/index.php on line 12
Warning: include() [function.include]: Failed opening 'http://www.domain.com/footer.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/domain/public_html/test/index.php on line 12
Any clue what can be wrong with Apache or PHP configuration?
Thanks