directory path problem in .php file during localhost

Problems with the Windows version of XAMPP, questions, comments, and anything related.

directory path problem in .php file during localhost

Postby codexxii » 21. March 2023 19:09

Hello all,
I not sure how to make the question or where is exactly the issue.

Using VScode Xampp github

After the addition of new line of code (<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/includes/DatesUtilsPolyfen.php');)
in the .php files I needed to modify. Now I cannot open the files in my LocalHost.

The problem is in the directory path for what i saw.

When trying to open the page in localhost the browser show me this message.

Warning: require_once(C:/xampp/htdocs/includes/DatesUtilsPolyfen.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\polyfen\sections\hello-bar.php on line 2

Fatal error: Uncaught Error: Failed opening required 'C:/xampp/htdocs/includes/DatesUtilsPolyfen.php' (include_path='\xampp\php\PEAR') in C:\xampp\htdocs\polyfen\sections\hello-bar.php:2 Stack trace: #0 C:\xampp\htdocs\polyfen\index.php(51): include() #1 {main} thrown in C:\xampp\htdocs\polyfen\sections\hello-bar.php on line 2


to handle with the issue I need to change the path in the file just for opening in LocalHost and then modify again to return and push to Github and work properly in LiveVersion.

This is how is originaly written in code:
"C:/xampp/htdocs/includes/DatesUtilsPolyfen.php'"
and this how fix it provisionally
C:/xampp/htdocs/POLYFEN/includes/DatesUtilsPolyfen.php'

In some way when in localHost is not finding the file because needs to remark the root folder of the project i downloaded from github.

Hope someone understand my issue and is able to help me

Thanks in advance.

Lean B.
codexxii
 
Posts: 1
Joined: 21. March 2023 18:58
XAMPP version: 3.3.0
Operating System: windows 10

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 214 guests