Page 1 of 1

include_once behaving differently inside Zend

Posted: Sun Jun 10, 2007 5:36 am
by roschler
I am trying to trace through Pligg, an open source program, using Zend Studio 4.0.2. I am running on a Windows 2000 test server using Apache, with "localhost" being the domain name.

The software uses the Smarty template system. The main PHP file, "index.php", uses "include" to load a file called "config.php". Through the template evaluation chain it then ends up loading a file called "sidebar_stories_u.php". That file uses "include_once" to load "config.php".

If I run the program outside the Zend environment, it works properly. When I run it in Zend, it fails. The difference in behavior is this. When run outside the Zend environment, when "sidebar_stories_u.php" evaluates "include_once('config.php');", it ignores it. I know this because I put a "print" statement at the top of "config.php" to let me know when it is being loaded/evaluated. However, when I run the program inside of Zend, when "sidebar_stories_u.php" evaluates "include_once('config.php');", it DOES reprocess it and that's when the errors start to happen.

I tried dumping out the actual file name that the included file "config.php" evaluates to when executed by "index.php" and "sidebar_stories_u.php", and in all cases the complete path was identical. I have no idea why the "include_once" statement in "sidebar_stories_u.php" ignores "config.php" when run outside the Zend environment, and does reprocess it when run inside the Zend environment. I also dumped out the include path and it was the same between the successful run and the failing run.

Does anyone have any ideas on how I can fix this?

Thanks.

Posted: Sun Jun 10, 2007 6:21 am
by volka
Have you tried the Zend Studio forum?
http://www.zend.com/forums/index.php?t=thread&frm_id=5

Posted: Sun Jun 10, 2007 8:48 am
by roschler
Yes I did. I also tried the Pligg forum. I got no replies on either of them.