包括父目录无效

So I have a site that uses subfolders for each subpage, however I can't get every directory to work.

the fotter.php is called in correctly, however not the head.php. What is wrong?

php-file:
<?php include_once("analyticstracking.php") ?>
<?php include('../head.php'); ?>
<?php include('header.php'); ?>
<?php include('counters.php'); ?>
<?php include('quiz.php'); ?>
<?php include('../goal.php'); ?>
<?php include('../footer.php'); ?>

You should include proper path. Try:

<?php include('/home/username/public_html/directory/head.php); ?>

Check if the head.php file has read permissions set for the user your webserver is running as (i.e., not you.) Depending on the operating system and web server there are many possibilities but the easiest would be probably to make it readable for all:

  • On Windows GUI: right click the file => Properties => Security;
  • On OS X: right click => Get Info => Sharing & Permissions;
  • On Linux: OS X, BSD, et al. in the command line, chmod 0644 head.php;
  • If it's on a remote server, your file transfer client should have some kind of interface to view file properties.