Jump to content

FileCompiler Error


matjazp
 Share

Recommended Posts

I have a template file (eg. basic-page.php) where I include some other files. If the included file is on /site/templates path it's ok, but if the file is included like this:

inlcude('C:\PHP\adodb5\adodb.inc.php');

then I get the following error:

Exception: Unable to create directory C:/inetpub/wwwroot/pf/site/assets/cache/FileCompiler/C:/PHP/adodb5/ (in C:\inetpub\wwwroot\pf\wire\core\FileCompiler.php line 135) #0 C:\inetpub\wwwroot\pf\wire\core\FileCompiler.php(201): ProcessWire\FileCompiler->initTargetPath() #1 [internal function]: ProcessWire\FileCompiler->___compile('adodb.inc.php') #2 C:\inetpub\wwwroot\pf\wire\core\Wire.php(348): call_user_func_array(Array, Array) #3 C:\inetpub\wwwroot\pf\wire\core\WireHooks.php(548): ProcessWire\Wire->_callMethod('___compile', Array) #4 C:\inetpub\wwwroot\pf\wire\core\Wire.php(371): ProcessWire\WireHooks->runHooks(Object(ProcessWire\FileCompiler), 'compile', Array) #5 C:\inetpub\wwwroot\pf\wire\core\WireFileTools.php(732): ProcessWire\Wire->__call('compile', Array) #6 C:\inetpub\wwwroot\pf\wire\core\WireFileTools.php(732): ProcessWire\FileCompiler->compile('adodb.inc.php') #7 C:\inetpub\wwwroot\pf\site\assets\cache\FileCompiler\site\templates\kontakti.php(242): ProcessWire\WireFileTools->compile('C:/PHP/adodb in C:\inetpub\wwwroot\pf\index.php on line 64

Using latest PW 3.0.33RC1. I also put //FileCompiler=0 in the included file as per https://processwire.com/blog/posts/processwire-3.0.14-updates-file-compiler-fields-and-more/#how-to-bypass-the-file-compiler 

  • Like 1
Link to comment
Share on other sites

Yes, it's invalid path, that's clear. I already copied adodb5 directory to /site/templates and it's working there. The problem is that I have multiple sites on this server and I have to copy adodb5 directory (and files) to all sites - it's duplication.

  • Like 1
Link to comment
Share on other sites

I see. Well, I just wanted to test:

  • "Setup > Templates > your-template. Click the Advanced tab, and choose "No" or "Auto" for the "Use Compiled File?"
  • vs
  • $config->templateCompile = false/true;

But the former is missing in ProcessWire 3.0.33 devns (BTW, it used to be under the Files tab, not Advanced in 3.0.28 and 3.0.30 at least)! Does anyone know what happened to this setting?

I used to set all of them to No (disables compiler), so that $config->templateCompile = false/true; can be used globally, and that was what I was about to suggest, but I cannot test it, 'cos the admin setting is gone...

Link to comment
Share on other sites

I can't use global compile flag, because some of the includes have to be compiled and some not. I expected that  //FileCompiler=0 would make FileCompiler to completely ignore the file, now it fails trying to create a directory with the invalid name on windows. 

  • Like 1
Link to comment
Share on other sites

9 minutes ago, matjazp said:

some of the includes have to be compiled and some not

We could also set these up in the admin on a template-by-template bases. Now its also gone. Something smells fishy..

Sure, in theory FileCompiler=0 would allow for more control.

Link to comment
Share on other sites

5 hours ago, szabesz said:

But the former is missing in ProcessWire 3.0.33 devns (BTW, it used to be under the Files tab, not Advanced in 3.0.28 and 3.0.30 at least)! Does anyone know what happened to this setting?

I think this is the "Use Compiled File?" section on the Files tab:

2016-09-06_105053.png

  • Like 1
Link to comment
Share on other sites

Thanks @Robin S, that is what I was afraid of... is it just me who is missing this block in PW 3.0.32 and 3.0.33? This is my screenshot:

(note: I have a ProcessWire site running on 3.0.28 where this block does show up, and I used to set this option for the site where it is gone from)

pw-3-0-32-and3-0-33-no-compiler-options.png

Edited by szabesz
and 3.0.33
Link to comment
Share on other sites

Oh my! I figured it out...

Currently I use: $config->templateCompile = false; but the block only shows up when $config->templateCompile = true;

I should not be surprised, but maybe the block itself should not disappear, but a simple message could be displayed reminding us to enable the compiler in the code in the first place...

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...