• Resolved Jos Klever

    (@josklever)


    I noticed these warnings in the error log of a client’s site:

    PHP Warning:  file_exists(): open_basedir restriction in effect. File(/opt/bitnami/wordpress/wp-load.php) is not within the allowed path(s)

    There’s no caching active on the website. The version of the plugin is 1.5.3.

    It looks like it’s testing for a file path in the root of the server and that doesn’t exist.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Hi @josklever,

    This is correct, this is a specific check for a bitnami setup. If the file doesn’t exist, it’s not bitnami, so the plugin continues with the checks for default WordPress configuration.

    Hope this helps!

    Thread Starter Jos Klever

    (@josklever)

    But it shouldn’t fill the error log on other servers with warnings…

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Not sure why the server gives a PHP warning on a simple file_exists() check. And it seems a bit overkill of the server to flood the logs with this warning. But I can check if we can reverse the order of checks.

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    I have created a version that does a check on openbasedir restrictions without warnings by disabling php logging here:

    https://github.com/Burst-Statistics/burst/tree/openbasedir-check

    Please check if this works for you.

    Thread Starter Jos Klever

    (@josklever)

    Hi Rogier,

    I want to test it, but the github version contains all kinds of extra files that don’t belong in the actual plugin. Do you have a version that’s ready to install?

    If it’s only the endpoint.php file that is relevant for this change, I’ll test that change.

    Thread Starter Jos Klever

    (@josklever)

    I get this notice no in the error log:

    2024-01-01 18:25:52.462198 [NOTICE] [2902679] [91.220.37.40:56612#leefhiernu.nl-443] [STDERR] PHP Fatal error:  Uncaught Error: Call to undefined function burst_has_open_basedir_restriction() in /.../wp-content/plugins/burst-statistics/endpoint.php:26
    Stack trace:
    #0 /.../wp-content/plugins/burst-statistics/endpoint.php(7): find_wordpress_base_path()
    #1 {main}
      thrown in /.../wp-content/plugins/burst-statistics/endpoint.php on line 26
    2024-01-01 18:25:52.516387 [NOTICE] [2902680] [91.220.37.40:56616#leefhiernu.nl-443] [STDERR] PHP Fatal error:  Uncaught Error: Call to undefined function burst_has_open_basedir_restriction() in /.../wp-content/plugins/burst-statistics/endpoint.php:26
    Stack trace:
    #0 /.../wp-content/plugins/burst-statistics/endpoint.php(7): find_wordpress_base_path()
    #1 {main}
      thrown in /.../wp-content/plugins/burst-statistics/endpoint.php on line 26
    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    @josklever apparently the function_exists check here results in some unexpected behaviour. I have removed this one, and this works without errors for me locally. Can you check again?

    Thread Starter Jos Klever

    (@josklever)

    The first tests are looking good! No errors so far, so I think it has been solved. I’ll mark this as resolved and will report back if needed.

    Thanks!

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Great, thanks for testing!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Warning about open_basedir restriction and non-existing file’ is closed to new replies.