-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oc-2069 - APPSROOTS not set corectly in OC 4.5 #770
Comments
Probably server is misconfigured C:/Inetpub/vhosts/abc.xyz;C:\Windows\Temp |
Yes. The error message shows that php is not allowed to read the template directory. This can´t be fixed from within ownCloud and is a server configuration bug. |
Could you please reopen this Bug?
I think everything works, although an error is shown, because of the code on line 306. The function OC_App::getAppPath($app) seems to return nothing:
As you can see it tries to access "/l10n/" and not the correct path. |
@japi Please post exact errors content here |
For example on the login page the following errors are displayed:
Below the login form:
and
(it is the same error, shown two times) Edit: |
Can you please try to run it without open_basedir ? |
@karlitschek OC_App::getAppPath($app) might return false if the app dir is not found. So it should be reproducible if the app has entry in DB but has no files in app directories. |
@karlitschek Sorry, i can't disable it. It is set via Fast-CGI parameter in my hosting environment. Deactivating it would most likely stop the warnings, but reducing security (even by a tiny bit like this) is not a good solution i think :-) It is a vanilla ownCloud installation and although there are warnings it seems to work. I have not tested much yet, because this is the first day i am using it. I switched display_errors off, so the warnings don't break the layout. But this is only a workaround in my opinion. |
From http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-2069
There are active reporters still checking.
The descriptions and comments:
Description:
Hi, I just updated from an older version to 4.0.8. Worked great! But when I updated to 4.5. as it is descriped in the update guide I got some PHP warnings:
PHP Warning: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (C:/Inetpub/vhosts/abc.xyz;C:\Windows\Temp) in C:\Inetpub\vhosts\abc.xyz\ownCloud\lib\template.php on line 245 PHP Warning: file_exists(): open_basedir restriction in effect. File(/l10n/) is not within the allowed path(s): (C:/Inetpub/vhosts/abc.xyz;C:\Windows\Temp) in C:\Inetpub\vhosts\abc.xyz\ownCloud\lib\l10n.php on line 302 PHP Warning: file_exists(): open_basedir restriction in effect. File(/l10n/) is not within the allowed path(s): (C:/Inetpub/vhosts/abc.xyz;C:\Windows\Temp) in C:\Inetpub\vhosts\abc.xyz\ownCloud\lib\l10n.php on line 302
To fix this I added this line to /lin/base.php function initPaths() OC::$APPSROOTS[1] = array('path'=>OC::$SERVERROOT,'url'=>,'writable'=>false);
Now it works ;)
Regards,
Khaos
Reproduction steps:
Don't know how to reproduce. But I'm using IIS7 on windows 2008 r2 server. All directory rights are set correctly, version 4.0.8. worked fine!
#2 Comment posted by Khaos Oct 18, 12:13
Adding path to APPSROOTS isn't the final solution! Going to /?app=settings&getfile=apps.php?installed will bring new Warnings.
PHP Warning: require_once(): open_basedir restriction in effect. File(../lib/base.php) is not within the allowed path(s): (C:/Inetpub/vhosts/abc.xyz;C:\Windows\Temp) in C:\Inetpub\vhosts\abc.xyz\ownCloud\settings\apps.php on line 24 PHP Warning: require_once(../lib/base.php): failed to open stream: Operation not permitted in C:\Inetpub\vhosts\abc.xyz\ownCloud\settings\apps.php on line 24 PHP Fatal error: require_once(): Failed opening required '../lib/base.php' (include_path='C:/Inetpub/vhosts/abc.xyz/ownCloud/lib;C:/Inetpub/vhosts/abc.xyz/ownCloud/config;C:/Inetpub/vhosts/abc.xyz/ownCloud/3rdparty;C:/Inetpub/vhosts/abc.xyz/ownCloud/apps;C:/Inetpub/vhosts/abc.xyz/ownCloud;C:/Inetpub/vhosts/abc.xyz/ownCloud/lib;.;./includes;./pear;C:/Inetpub/vhosts/abc.xyz/ownCloud') in C:\Inetpub\vhosts\abc.xyz\ownCloud\settings\apps.php on line 24
#3 Comment posted by DjGL Nov 21, 12:43
I fixed both problems by replacing the findAppInDirectories funcion in /lib/apps.php with
protected static function findAppInDirectories($appid) {
static $app_dir = array();
if (isset($app_dir[$appid])) {
return $app_dir[$appid];
}
foreach(OC::$APPSROOTS as $dir) {
if(file_exists($dir['path'].'/'.$appid)) {
return $app_dir[$appid]=$dir;
}
}
if(file_exists(OC::$SERVERROOT.'/'.$appid))
return array('path'=>OC::$SERVERROOT,'url'=>OC::$WEBROOT);
return false;
}
If you still get errors in the settings you might also replace loadAppScriptFile in /lib/base.php with
protected static function loadAppScriptFile($app, $file) {
$app_path = OC_App::getAppPath($app);
$file = $app_path . '/' . $file;
unset($app, $app_path);
if (file_exists($file)) {
chdir(dirname($file));
require_once basename($file);
//require_once $file;
return true;
}
return false;
}
The text was updated successfully, but these errors were encountered: