-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
– LeonanCarvalho
this code I bought it, and in test environment it worked perfectly, I’m just not getting why it is with this problem here.
– Kaio Rodrigo
In the question you comment you are importing the file
app.php
; already error gives in the filepublic/index.php
. That is, the code you put in the question is not the one that is giving error. Then check the fileserver.php
, line 21. But given the file path that was not located, I would say it lacked a/
incore_invapp../
– Woss
The answer is in my previous comment.
– Woss
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)
– Kaio Rodrigo