matjazp Posted September 5, 2016 Share Posted September 5, 2016 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 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 5, 2016 Share Posted September 5, 2016 "C:/inetpub/wwwroot/pf/site/assets/cache/FileCompiler/C:/PHP/adodb5/" ? Does not look like a valid path. Anyway, why not include __DIR__ . '/adodb.inc.php'; ? 1 Link to comment Share on other sites More sharing options...
matjazp Posted September 5, 2016 Author Share Posted September 5, 2016 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. 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 5, 2016 Share Posted September 5, 2016 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 More sharing options...
matjazp Posted September 5, 2016 Author Share Posted September 5, 2016 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. 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 5, 2016 Share Posted September 5, 2016 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 More sharing options...
Robin S Posted September 5, 2016 Share Posted September 5, 2016 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: 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 6, 2016 Share Posted September 6, 2016 (edited) 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) Edited September 6, 2016 by szabesz and 3.0.33 Link to comment Share on other sites More sharing options...
szabesz Posted September 6, 2016 Share Posted September 6, 2016 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... 1 Link to comment Share on other sites More sharing options...
matjazp Posted September 6, 2016 Author Share Posted September 6, 2016 @szabesz glad you figured it out but that does not solve the file compiler error... should I open github issue or it's unsupported to include files outside of base directory structure (on windows)? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now