This topic is locked
[SOLVED]

 Not Understanding Why I'm Getting Error

4/18/2013 11:15:18 PM
PHPRunner General questions
W
wildwally author

I have a custom file made to utilize PHPExcel. Prior to any modifications it works with no problems, but I want to take out the db connection code within the file and utilize PHPR dbcommon.php file for my connection string. So I have less things to worry about.
So I changed everything (my queries to now use db instead of mssql) and added the include. But now when the file tries to open I receive an error for a file I include in the "After application initialized" event section.
Warning: include_once(other-config.php) [function.include-once]: failed to open stream: No such file or directory in \include\appsettings.php on line 474
Warning: include_once() [function.include]: Failed opening 'other-config.php' for inclusion (include_path='.;C:\PHP\pear;C:\PHP\PEAR') in {mysiteaddress}\include\appsettings.php on line **474
Line 474 is as follow:



// here goes EVENT_INIT_APP event

include_once ("other-config.php");


**which is the item i added in the After application intialized events that calls my custom functions throughout the rest of the site. What am i doing wrong?

Admin 4/19/2013

It depends on where your include fiel is located. Try something like this just in case:

include(getabspath('other-config.php'));
W
wildwally author 4/19/2013



It depends on where your include fiel is located. Try something like this just in case:

include(getabspath('other-config.php'));



Thanks, that solved my problem.