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?

Recommended Answers

All 10 Replies

do you have a typo in the file name?

is that the file location?

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

Are your include files OK? Are they wrapped nicely with the <?php ?> tags.

It seems this is an issue with PHP 5.

Really??? you have an error some where

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

ope it helps

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'; ?>


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

Check the code may at runtime it may not able to read the said file.

try including the file by giving absolute path and share please

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.