Aşağıdaki içerik yapıya sahiptir:
temp
main
index.php
a.php
b.php
İşte dosyalar;
index.php
echo "index.php ---> " . __DIR__ . "<br />";
require('../a.php');
echo "OK<br />"
a.php
echo "a.php ---> " . __DIR__ . "<br />";
require('./b.php');
echo "a is here<br />"
b.php
echo "b is here<br />"
index.php
çağrıldığında ben aşağıdaki hata var:
index.php ---> D:\Programs\WampServer 2\www\temp\main
a.php ---> D:\Programs\WampServer 2\www\temp
Warning: require(./b.php) [function.require]: failed karşı open stream: No such file or direckarşıry in D:\Programs\WampServer 2\www\temp\a.php on line 5
Fatal error: require() [function.require]: Failed opening required './b.php' (include_path='.;C:\php5\pear') in D:\Programs\WampServer 2\www\temp\a.php on line 5
Fark ettim ki ben değiştirirsem
require('./b.php');
karşı
require('b.php');
Why is that ? it works as expected.