user1899829
user1899829

Reputation: 407

require file doesn't exist until refresh

I have a require line in my php script.

require_once('../main.inc.php');

every once in a while, when I load a page, I get a message 'failed to open stream. no such file or directory'

But when I hit refresh, the page loads just fine.

What might be happening that the script can't seem to find the file until I simply refresh?

I am really hitting the error at this point before I use the require/include

if(!file_exists('../main.inc.php')) die('Fatal error

Upvotes: 1

Views: 78

Answers (1)

Egnate Tsaava
Egnate Tsaava

Reputation: 11

try

include('../main.inc.php');

Upvotes: 1

Related Questions