include statement

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

include statement

Postby Night » 27. January 2016 07:56

Slowly getting things to work but ran into a problem not sure how to resolve. Getting this error when trying to go to a link:

Warning: require(includes/application_top.php): failed to open stream: No such file or directory in C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012\index.php on line 26

Fatal error: require(): Failed opening required 'includes/application_top.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012\index.php on line 26

This is part of the code calling the include:
/**
* Load common library stuff
*/
require('includes/application_top.php'); THIS IS LINE 26

$language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
$directory_array = $template->get_template_part($code_page_directory, '/^header_php/');
foreach ($directory_array as $value) {
/*

I changed it to this in hopes it would fix the problem:
*/
/**
* Load common library stuff
*/
require('includes/thedreamweaver/zen-cart-v1.5.1-full-fileset-09182012/application_top.php');

$language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
$directory_array = $template->get_template_part($code_page_directory, '/^header_php/');
foreach ($directory_array as $value) {
/*
This is where the file is located C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012\includes\application_top.php
any ideas?
Night
 
Posts: 5
Joined: 26. January 2016 03:51
Operating System: win 8.1 Pro

Re: include statement

Postby Nobbie » 27. January 2016 12:50

Night wrote:This is where the file is located C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012\includes\application_top.php
any ideas?


Undo your changes, then edit php.ini, look for "include_path" and extend the value by C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012. Finally restart Apache.

Anyway, your changes are nonsense, they point to a non-existing path:

Night wrote:require('includes/thedreamweaver/zen-cart-v1.5.1-full-fileset-09182012/application_top.php');


You could have changed it to that (instead of editing php.ini):

Code: Select all
require('C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012\includes\application_top.php');


but i prefer not to change the source, instead change php.ini
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: include statement

Postby Altrea » 27. January 2016 13:14

We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: include statement

Postby Nobbie » 27. January 2016 13:24

I wonder why it fails to include, as '.' is already part of include_path (which basically yields to the same location as __DIR__)?! Maybe it should be './' instead?
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: include statement

Postby Altrea » 27. January 2016 13:41

Nobbie wrote:I wonder why it fails to include, as '.' is already part of include_path (which basically yields to the same location as __DIR__)?! Maybe it should be './' instead?

The only difference between already being . in the include_path and using __DIR__ is that __DIR__ transforms this reference to an absolute path.
The include path works as expected as long as there is no document with the same relative path present in the other include path folders like PEAR.

But this problem here is not solvable because in my test environment it is successfully working with the given information without changing anything to the require code.
So either the information here is wrong or zen cart is doing something magic here to produce that problem.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: include statement

Postby Nobbie » 27. January 2016 19:07

Altrea wrote:The only difference between already being . in the include_path and using __DIR__ is that __DIR__ transforms this reference to an absolute path.


I know, but according to the given input that *should* be the current directory ".".

Altrea wrote:But this problem here is not solvable because in my test environment it is successfully working with the given information without changing anything to the require code.
So either the information here is wrong or zen cart is doing something magic here to produce that problem.


Or the description is wrong...
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: include statement

Postby Night » 29. January 2016 05:35

Nobbie wrote:
Night wrote:This is where the file is located C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012\includes\application_top.php
any ideas?


Undo your changes, then edit php.ini, look for "include_path" and extend the value by C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012. Finally restart Apache.

Anyway, your changes are nonsense, they point to a non-existing path:

Night wrote:require('includes/thedreamweaver/zen-cart-v1.5.1-full-fileset-09182012/application_top.php');


You could have changed it to that (instead of editing php.ini):

Code: Select all
That is an existing path but I guess it won't work that way. Changed the php.ini file and that did take care of the problem. Thanks. As I keep plugging along, I will post when and if I run into another problem I can't fix.
require('C:\xampp\htdocs\thedreamweaver\zen-cart-v1.5.1-full-fileset-09182012\includes\application_top.php');


but i prefer not to change the source, instead change php.ini
Night
 
Posts: 5
Joined: 26. January 2016 03:51
Operating System: win 8.1 Pro

Re: include statement

Postby Night » 31. January 2016 02:13

Dumping my host, say my SQL server is gone! what ever that means!
Night
 
Posts: 5
Joined: 26. January 2016 03:51
Operating System: win 8.1 Pro


Return to XAMPP for Windows

Who is online

Users browsing this forum: DrSeussFreak and 69 guests