include_once error

Hello, first let me say I'm a beginner in PHP, specifically PHP Object-oriented programming. 

I'm on a V7.0.9 dolphin version.

While I'm trying to include a class.php from a 3rd-part developer I work with 

<?php

include_once ('modules/developer/configure/classes/class.php');

I get this error : 

Warning: include_once(modules/developer/configure/classes/ClassExample.php): failed to open stream: No such file or directory in /var/www/vhosts/mysite.com/httpdocs/dolphin/inc/classes/BxDolPageView.php(612) : eval()'d code on line 2 Warning: include_once(): Failed opening 'modules/developer/configure/classes/ClassExample.php' for inclusion (include_path='.:') in /var/www/vhosts/mysite.com/httpdocs/dolphin/inc/classes/BxDolPageView.php(612) : eval()'d code on line 2 Fatal error: Class 'ClassExample' not found in /var/www/vhosts/mysite.com/httpdocs/dolphin/inc/classes/BxDolPageView.php(612) : eval()'d code on line 6

I'm trying to figure out where is the problem... is it a Boonex problem? or is it linked to my server configuration? I really don't know where to begin to resolve...

Thx in advance for your kind help if you get knowledge on it

Quote · 30 Oct 2013

The error is that it can not find the file.  First make sure the file is in the location that you are trying to include it from.  If it is there, then paste the line of code where you are trying to include the file so we can see if you are doing it properly.  Tell us where the file is suppose to be and the line of code where you try to include the file.

Geeks, making the world a better place
Quote · 30 Oct 2013

I doubled check the file and, yes, it is actually on the right folder

/modules/afk/configure/classes/AfkCfgmeDB.php (where afk , configure , AfkCfgmeDB.php are 3rd part real filenames)

Here is the script I try to make working

include_once ('modules/afk/configure/classes/AfkCfgmeDB.php');

$memberiID = getID( $_GET['ID'] );

$CatArray = new AfkCfgmeDB();

$CatArray -> getAllInterest ($memberiID);

echo $CatArray;

I'm aware that the code might be totally wrong... Again, I'm a noob on poo php development, I try mostly to understand how works classes, objects etc. But the point is that I can't even make the very first point happen (namely : call the class on my script with neither include_once nor include, require_once, require) and, then, I can't test my code and I'm blocked.

Practically, I'm calling the script from inside a boonex PHP block - http://www.boonex.com/n/How_to_Add_PHP_in_a_BLOCK- inside /blogs/home/. Then the path has to be /modules... but I tried also /modules, my site/modules/, /mysite/modules/ and none of theses work. I have even try to use the __DIR__ constant as well as the __FILE__ constant with this code (which someone gave me on stack) : 

$path = dirname(__FILE__).'/'; include_once ($path.'modules/developer/configure/classes/class.php');

http://stackoverflow.com/questions/19678902/include-once-error-failed-to-open-stream-in-boonex-dolphin-v7-0-9

As I understand the error, it seems that BxDolPageView.php is doing an eval() on my script and block the include_once. And since the file is on the right place, I begin to think that file is not on authorised include path, or something like that... Then I'm wondering how others developers do to call their own functions when they got multiple scripts... not sure... totally blocked.

 

Quote · 31 Oct 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.