PHP error failed to open stream/failed opening

913

These are the errors I have:

Warning: include(core/init.inc.php):
    failed to open stream: No such file or directory in test.php on line 2

Warning: include(): Failed opening '/core/init.inc.php'
    for inclusion (include_path='.;C:\php\pear') in test.php on line 2

Here is my code:

init.inc.php

<?php
$path = dirname(__FILE__);

include("{$path}/inc/csv.inc.php");
include("{$path}/inc/users.inc.php");
?>

test.php

<?php
include('/core/init.inc.php');
?>

Normally I should have at this white screen, but I got all errors immediately, anyone have any idea that this could be?

I followed this tutorial on the web: https://www.youtube.com/watch?v=TqhSrBJHTIY (3 parts)

I think I have as in the tutorial. Yet done the same:

enter image description here

436

Answer

Solution:

As written in the comments, your files are not called.inc.php - they're called.inc. That means thatinit.inc.php in fact, does not exist, butinit.inc does.

enter image description here

You have two options:

  • Rename yourinit.inc toinit.inc.php,csv.inc tocsv.inc.php andusers.inc tousers.inc.php
  • Change yourinclude statements to useinclude('core/init.inc'); instead.

People are also looking for solutions to the problem: php - Symfony2 Unrecognized options "simple_form" under "security.firewalls.main"

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.