PHP warnings showing up for includes in original code

I just installed Sitecake and it looks to be working fine.
There’s one slight problem, though. I use Sitecake on a PHP site and in the original code there are some includes.
While editing I get warnings that the includes can’t be found and after editing the includes are just gone.

Is there any other solution than converting my PHP code to static html before attempting to use Sitecake?

[EDIT] the includes are not gone after editing, they just work.
So this is mainly a cosmetic problem. I would prefer not to show any warnings on pages that my client is going to edit.

Are paths to includes relative? What error do you get?

Yes, the paths to the includes are relative.
Two warnings per include. First one “failed to open stream” - it looks for the include (…/inc/includename.inc.php) in [SITE}/sitecake/2.4.5/src/Sitecake/Page.php

Second one : “Failed opening” …inc/includename.inc.php for inclusion (include path /opt/cpaneel/ea-php71/root/usr/sahre/pear:[SITE]/sitecake/2.4.5/vendor/electrolinux/phpquery/phpQuery/phpQuery/:[SITE]/sitecake/2.4.5/vend …(cut off)

Just changed the includes to absolute paths (/home/username/publc_html/etc…) and that does the trick. :slight_smile:
Thanks!

Hi, problem with full path is that you won’t be able to see changes if you just edit container inside included file and refresh the page. You will be able to see it only after publish. Strange is that relative paths should work. Is the file that is included outside of site root dir? That could be the reason why you are getting error.
Also, if file you are including is only php file with some configuration or any php code and it does not contain any sc-content containers, approach with full path is just fine.

The inc files are inside the site root. But since I don’t (plan to) have any sc-content containers in the included files using the absolute path works fine.
Problem solved for me. :slight_smile: