PHP include not working?
Hello,
I want to implement a file, but it tells me the page isn't found, even though it exists. I've checked several times for any typos. This message is followed by:
Warning : include(): Failed opening '/u/…/m/Feb/….html' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\u\..\index.php on line 44
Can anyone help me?
ChatGPT says (has quite often right to debugging):
I checked the path, but when I hit the link of the file that is supposedly missing, I come out on the exact page that is allegedly missing 😅
Have you given the path relatively, or absolutely. Try the relative variant. Is that an HTML file you’re logging in? In my knowledge you can only include other PHP files.
Once it’s done, “C:/xampp/htdocs” had to set before linking.
On one page already have the include, actually in html. Can also implement txt files. On the Include is there and is found
Hi,
this error occurs when the file is not present or the path is incorrect. That means you have to control your path. Sometimes you get problems with relative paths.
Somehow, there’s something going on between Windows (‘C:\xampp\php\PEAR’) with backslashes and Unix / Linux (‘/u/…/m/Feb/….html’).
And then big and small letters that Windows pass by the Ar***, but are taken exactly by Linux.