ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PHP Include Errors

July 13, 2010 12:12pm

Subscribe [4]
  • #1 / Jul 13, 2010 12:12pm

    mzuser

    47 posts

    I have a page that consists of alot of php and I’m including pages that have additional functionality. I’m trying to add this page to my EE templates. However when I do I get this error:

    Warning: include(/templates/site/included_page.php) [function.include]: failed to open stream: No such file or directory in /home/user/www.example.com/system/core/core.functions.php(653) : eval()'d code on line 13

    So it’s not finding my included page, but I’m confused as to why. It seems like it’s looking for it in the core folder of my EE directory? Wouldn’t the include path be relative to where the template file is?

  • #2 / Jul 13, 2010 1:44pm

    Tom Jaeger

    497 posts

    The include path should be relative to where the file is being “executed”.  In this case it is in the core folder. If you were to make the path relative to that, or absolute you should be all set.

    so ‘../templates/site/included_page.php’ should do it if you have your templates in the system directory.


    It’s also probably worth confirming that the template is saved as a file.

    Hope that helps!

  • #3 / Jul 13, 2010 3:43pm

    Ingmar

    29245 posts

    Thanks, Tom. Does that help, matthew?

  • #4 / Jul 13, 2010 5:00pm

    mzuser

    47 posts

    I tried about every combination of dots and backslashes I could think of but to no avail. I even tried putting my code directly in the system folder instead of the templates folder. Still got errors.

    So I went for my other option and that is an iframe. With a little jquery to resize it on the fly. Not the most ideal, but at least I can have all my menus and everything from EE.

    If I had more time I’d try more, but I’m under the gun here. Something I’m sure most developers know…

    Appreciate the help though!

  • #5 / Jul 13, 2010 8:48pm

    Brandon Jones

    5500 posts

    Glad you have a solution for now, matthewordie. Don’t hesitate to post again.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases