disc@puff:~/php$ ls a.php data include disc@puff:~/php$ tree . ├── a.php ├── data │ └── d.php └── include ├── b.php └── c.php 2 directories, 4
As you're starting with a.php, you should define the include directories in a.php:
a.php
define('MY_INCLUDES', dirname(__FILE__) . '/include/'); define('MY_DATA', dirname(__FILE__) . '/data/');
Afterwards include the files with absolute paths:
include(MY_INCLUDES . 'b.php'); include(MY_DATA . 'c.php');