Random open_basedir restriction error


(g.caltanetti) #1

Hi to all.

I’ve been using Piwik for the last few days and have been very impressed with the program, so far. It’s refreshing to use a spyware-free stats program.

Since yesterday, sometimes when I access the admin panel I encounter an open_basedir restriction error. It’s random, happens at anytime and goes away by itself. I’ve noticed the same behavior also on the js tracking code. I’m using the php gziped version. I’ve checked folder and files permissions, chowned the folders to my apache user, restarted Apache, reinstalled Piwik, all without success.

The exact message that appears is:

require() [function.require]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/username:/usr/lib/php:/usr/local/lib/php:/tmp)
in ‘/full_path/stats/core/Translate.php’ at the line 36

#0 Piwik_ErrorHandler(2, require() [function.require]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/username:/usr/lib/php:/usr/local/lib/php:/tmp), /full_path/stats/core/Translate.php, 36, Array ()) called at [/full_path/stats/core/Translate.php:36]
#1 Piwik_Translate::loadEnglishTranslation() called at [/full_path/stats/core/Translate.php:36]
#2 Piwik_Translate->loadEnglishTranslation() called at [/full_path/stats/core/FrontController.php:196]
#3 Piwik_FrontController->init() called at [/full_path/stats/index.php:59]

Any ideas? style_emoticons/<#EMO_DIR#>/ohmy.gif

Thank you,

g.caltanetti


(vipsoft) #2

What php version? It sounds like a php bug because line 36 includes the English text using an absolute path.


(g.caltanetti) #3

Hi, vipsoft.

I’m using PHP 5.3.3 and Apache 2.2.16.

When I try to print that include path, it prints a valid path, but still the file is not included. Puzzling. Is there any test you’d want me to do?

Thank you,


(g.caltanetti) #4

Disabling open_basedir protection for the host where Piwik is installed solves the problem.

I’ll leave it on for now and run some tests to see if I find the problem.

Thanks,


(vipsoft) #5

I assume /full_path is within /home/username.

Line 36 should be attempting to load /full_path/stats/lang/en.php

If that file doesn’t exist, you’d be seeing a lot of problems in the dashboard.


(g.caltanetti) #6

The full path is correct and under the username homedir, so that open_basedir restriction should not apply. The translation file is there. Really puzzling.

Anyway, I’ll keep and eye on it and report back here if I find the cause.

Thank you,


#7

Okay i was able to fix the Problem.

Had the same Problem the whole day becouse i have in my Webserver Configuration
like you open_basedir for security reasons enabled.

The Fix for this Problem is afaik very easy.

As you have posted in your First Question this is just a warning that for some very strange reason is total unrelated.
I personally itself do not knoe why this Warning is Printed out.

If you how ever change the line number 83 in /core/Translate.php from


require $path;

to just simple


@require $path; // The @ does Disable Output of the Warning Message

Everything works like it should!

Hope i could Help with this very nasty Problem.