• Resolved harold70k

    (@harold70k)


    Dear mr. Waas,

    First of all: thanks a lot for providing this nice plugin!
    I've recently installed and configured it and it displays the contents of my Google agenda well.

    So far so good. But when consulting the error_log (in Plesk environment) I discovered repetitive error reports for the plugin that seem to boil down to an open_basedir restriction. (I'm currently using WP version 6.8.2. and Plesk Obsidian 18.0.72 on linux Ubuntu 24.02).

    To be more precise, I add a recent error report:

    2025-09-18 12:05:22.752165 [NOTICE] [3828621] [T0] [77.249.110.190:47968:HTTP2-1#APVH_mysite.nl:443] [STDERR] PHP Warning: file_exists(): open_basedir restriction in effect. File(ActionScheduler_Lock.php) is not within the allowed path(s): (/var/www/vhosts/mysite.nl/:/tmp/) in /var/www/vhosts/mysite.nl/httpdocs/wp-content/plugins/simple-google-icalendar-widget/includes/Classloader.php on line 48\n

    2025-09-18 12:05:22.752397 [NOTICE] [3828621] [T0] [77.249.110.190:47968:HTTP2-1#APVH_mysite.nl:443] [STDERR] PHP Warning: file_exists(): open_basedir restriction in effect. File(ActionScheduler_OptionLock.php) is not within the allowed path(s): (/var/www/vhosts/mysite.nl/:/tmp/) in /var/www/vhosts/mysite.nl/httpdocs/wp-content/plugins/simple-google-icalendar-widget/includes/Classloader.php on line 48\n

    2025-09-18 12:05:22.761007 [NOTICE] [3828621] [T0] [77.249.110.190:47968:HTTP2-1#APVH_mysite.nl:443] [STDERR] PHP Warning: file_exists(): open_basedir restriction in effect. File(ActionScheduler_DateTime.php) is not within the allowed path(s): (/var/www/vhosts/mysite.nl/:/tmp/) in /var/www/vhosts/mysite.nl/httpdocs/wp-content/plugins/simple-google-icalendar-widget/includes/Classloader.php on line 48\n

    In the Classloader.php file it reads:

    ..
    40 {
    41 $file = str_replace([
    42 NAMESPACE,
    43 '\'
    44 ], [
    45 DIR,
    46 DIRECTORY_SEPARATOR
    47 ], $class) . '.php';
    48 if (file_exists($file)) {
    49 require $file;
    50 return true;
    51 }
    ..


    I contacted the hosting provider who replied that the open_basedir restriction is set for security reasons and wondered whether the plugin is up to date. Is there any way to resolve this error and avoid the growing list of error reports? As said, apart from this, the plugin works well.

    Looking forward to your response.
    Many thanks in advance,

    Harold
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bramwaas

    (@bramwaas)

    Hi Harold,

    thank you for using my plugin and reporting this issue

    As I see in your report it seems my classloader tries to find (and load) a Class file of an other plugin (probably ActionScheduler or Woocommerce) outside the directories of my plugins namespace, maybe because it is called before all variables are correctly initialized. I will look further into it and hope soon to come with a solution.

    Regards Bram

    Plugin Author bramwaas

    (@bramwaas)

    Hi,

    are you sure that the spelling of the code in Classloader lines 40 to 51 is what you see.

    It should be:

    public static function load($class)
    40 {
    41 $file = str_replace([
    42 __NAMESPACE__,
    43 ‘\\’
    44 ], [
    45 __DIR__,
    46 DIRECTORY_SEPARATOR
    47 ], $class) . ‘.php’;
    48 if (file_exists($file)) {
    49 require $file;
    50 return true;
    51 }
    52 return false;
    53 }

    Plugin Author bramwaas

    (@bramwaas)

    Hi Harold,

    I just released version 2.7.1 to solve this issue.

    I have made an additional selection on Namespace in the start of the Classloader load() function to prevent searching for Class-files of other plugins in unwanted (forbidden) directories.

    Kind regards,

    Bram Waasdorp.

    Thread Starter harold70k

    (@harold70k)

    Hi Bram,

    Many, many thanks for your fast reply and for solving the issue on such a short notice!
    I just updated the plugin and the production of error-reports indeed has stopped.
    As for me, five stars for your service!

    Probably not so relevant anymore, but still in answer to you previous message; I rechecked the code in the classloader.php file and it is exactly as you said it should be. Minor deviations (missing underscores in lines 42 and 45, and a missing backslash in line 43) somehow must have slipped in there … my apologies for this!

    Kind regards,
    Harold

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP warning / open_basedir restriction’ is closed to new replies.