0

Good day,

I am working on atomizing a template creating includes in a sub-directory called includes and calling them like this

<?php include 'includes/head.php'; ?>

I have also tried

 <?php include('includes/head.php'); ?>

My page won't load. All I get is a blank browser window. I tried tailing the error.log and nothing is appearing there.

Googling the issue, I have come across this challenge some had on network servers after upgrading from PHP 4 to 5 and Zend optimizer. My server isn't complex as it is only a development environment.

Has anyone else had a similar issue and can offer a solution?

6
Contributors
10
Replies
14
Views
5 Years
Discussion Span
Last Post by Squidge
0

I've gone over things with a fine tooth comb. There are no typos. It seems this is an issue with PHP 5.

0

Try out
<?php include("head.php")?>
or <?php include_once("head.php")?>

ope it helps

0

Or you can try require instead of include. it is the same as include only that require throws an error (while include emits only warning).

<?php require 'includes/head.php'; ?>

or

<?php require_once 'includes/head.php'; ?>
0

try including the file by giving absolute path and share please

Edited by baig772

0

Thank you all for the constructive ideas to solve this. I have tried include, include_once, require, require_once.

Using any of the above variations did not trigger an error in the apache error log.

I know for certain it is not a challenge with spelling or some similar syntax error for if I give an absolute path to the include syntax, the include will work.

0

dwlamb, with includes you need to include the path unless you have include the include path in your ini file

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.