PHP included header doesn't appear in XAMPP testing server

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

PHP included header doesn't appear in XAMPP testing server

Postby hbograd » 02. July 2016 02:15

I've installed XAMPP and want to use it as a testing server on my Windows 10 computer, so I can make simple changes to a web site that was created by our web consultant, and see what changes will look like without first uploading them to our remote web server. When I was using a Windows 7, and before my old hard drive crashed, the XAMPP testing server was working properly. But now a year later when I want this to work with Windows 10 and a new installation of Dreamweaver, I'm having troubles - the testing server will show the body of each page but not the navigation bar and other things that come from the header file in the "Includes" folder. In other words, when I open Google Chrome and type in this URL: http://localhost/kulanuwebsite/folder/filename.php, it shows me the page without all the elements that should have come from files in my includes folder. The includes folder is really located on my computer in c:\xampp\htdocs\kulanuwebsite\includes


I can run the little test file as instructed in a simple online tutorial here: http://www.fayazmiraz.com/how-to-run-your-first-php-code/

But when I run any page on my organization's web site, I can see the body of the page, but not the navigation bar and other things that were set up in the header which is stored in our "includes" folder

Here is the code at the top of the php file:

<?
$title="Kulanu Communities: Madagascar";
ini_set("include_path", ":/var/www/html/includes");
include("../includes/header.php");
?>

Now that I look at it, I'm guessing that the problem is that the local testing server isn't finding the path to the includes folder. Does that guess make sense? I'm also guessing that there is an .ini file somewhere that is relevant. (My guesses come from reading things that I don't understand, but I'm trying to get the gist of what I'm reading).

Please treat me as a an basic beginner - I really don't know much about php, though I've been living with a php based web site which consultants have created for me for many years.

Thanks for your help.
hbograd
 
Posts: 2
Joined: 25. May 2016 21:08
XAMPP version: 3.2.2
Operating System: Windows 10

Re: PHP included header doesn't appear in XAMPP testing serv

Postby JJ_Tagy » 02. July 2016 02:29

hbograd wrote:ini_set("include_path", ":/var/www/html/includes");

Well, this won't find what it is looking for. Typically that is what a Linux path looks like. So your Windows path will be different.

As for the next line, it is relative to where the calling file is located. So that part looks ok if your description of your setup is correct.
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 36 guests