Welcome Guest, Not a member yet? Register   Sign In
Include function problem using xampp 1.7.3
#1

[eluser]old_guy[/eluser]
I've upgraded to xampp 1.7.3 and include() function has stopped working. I'm calling the include function within views/sub_folder/file.php

Code:
// client detail summary
    include ("view_clientHeader.php");

But I'm getting this error message:

Code:
A PHP Error was encountered

Severity: Warning

Message: include(view_clientHeader.php) [function.include]: failed to open stream: No such file or directory

Filename: libraries/Loader.php(673) : eval()'d code

Line Number: 15

The called view and the view with the include function are in the same folder. The include function was working fine in xampp 1.7.2. Is there something within the apache/conf/httpd.conf file that needs to be changed?

Any help appreciated.
#2

[eluser]danmontgomery[/eluser]
CI is run from the directory where index.php is located... You could either change the path in the include, or add the directory the file is in to your include path.
#3

[eluser]old_guy[/eluser]
Added the folder (under the views folder) that contain the files
Code:
include ("client/view_clientHeader.php");

But, still get the same error message
Code:
Message: include(client/view_clientHeader.php) [function.include]: failed to open stream: No such file or directory
#4

[eluser]danmontgomery[/eluser]
index.php is located outside of your system directory. include(), not being a CodeIgniter function, does not know to look in your view folder.

Code:
include('system/application/views/client/view_clientHeader.php');
#5

[eluser]old_guy[/eluser]
Solved the problem, at least temporarily. It doesn't make any sense but the only way I could get
Code:
include ("view_clientHeader.php");
to work was to specify the file path in the xampp php.ini file
Code:
include_path = ".;C:\xampp\php\PEAR;C:\xampp\htdocs\introMgr\system\application\views\clients\;"

For whatever reason the CI load library won't do it on the fly.




Theme © iAndrew 2016 - Forum software by © MyBB