require_once does not find my files Laravel

Asked

Viewed 19 times

-4

I have this require DIR that is not able to fetch the files, I have tried to write the complete path and in a more simplified way, if anyone can help me thank you

require_once __DIR__.'../public/index.php';

the following directory exists but it does not find it, and when I start the server appears the following error:

Fatal error: require_once(): Failed Opening required 'C: xampp htdocs investorm core_invapp.. /public/index.php' (include_path='C: xampp php PEAR') in C: xampp htdocs investorm core_invapp server.php on line 21

who can help I am grateful

  • Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.

  • The use of requires in this way is not good practice in php, I recommend taking a look at the auto loading solutions https://www.php.net/manual/en/language.oop5.autoload.php

  • this code I bought it, and in test environment it worked perfectly, I’m just not getting why it is with this problem here.

  • 1

    In the question you comment you are importing the file app.php; already error gives in the file public/index.php. That is, the code you put in the question is not the one that is giving error. Then check the file server.php, line 21. But given the file path that was not located, I would say it lacked a / in core_invapp../

  • The answer is in my previous comment.

  • I was able to display the page, but now it doesn’t find css, it only shows html and in the console it presents the following merge : GET http://127.0.0.1:8000/Assets/css/apps.css)

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.