• Resolved bobjgarrett

    (@bobjgarrett)


    I am getting the following error repeatedly in the php error log when using the WordPress dashboard.

    [23-Feb-2022 09:00:29 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(C:\Inetpub\vhosts\mysite.co.uk\httpdocs/wp-content/plugins/https://www.mysite.co.uk/wp-admin/admin.php) is not within the allowed path(s): (C:/Inetpub/vhosts/mysite.co.uk\;C:\Windows\Temp\) in C:\Inetpub\vhosts\mysite.co.uk\httpdocs\wp-admin\menu-header.php on line 256

    If I deactivate All In One SEO then the errors stop. Can you suggest a reason for this, which has only started since mid February.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @bobjgarrett,

    Are you using IIS to host your website?

    Thread Starter bobjgarrett

    (@bobjgarrett)

    Yes, it is on a Windows server.

    Plugin Author arnaudbroes

    (@arnaudbroes)

    This is a PHP security setting that is AFAIK enabled by default in IIS and it prevents the web server from accessing files in certain directories.

    You’ll need to open the php.ini configuration file for the PHP version that IIS is using and the comment out the open_basedir rule by adding a semi-colon in the front of it like this:

    ;open_basedir=C:/Inetpub/vhosts/mysite.co.uk\;C:\Windows\Temp\

    Once that’s done, you need to restart IIS.

    Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @bobjgarrett,

    I’ll close this thread now since I haven’t heard back from you, but please feel free to ping me in case you still need any help.

    Thread Starter bobjgarrett

    (@bobjgarrett)

    The problem seems to have been resolved by the hosting company increasing PHP resources which seems a bit strange given the error.

    Plugin Author arnaudbroes

    (@arnaudbroes)

    That does seem a bit strange indeed. But I’m glad to hear it’s been resolved!

    Thread Starter bobjgarrett

    (@bobjgarrett)

    I am sorry to say that it did not solve the problem. Turning on the WordPress debug at the same time simply moved where the errors were being logged. So I have been doing some further analysis.
    As in my first post the error arises when wp-admin\menu-header.php on line 256 is executed but not every time!
    This line says:
    && file_exists( WP_PLUGIN_DIR . “/$sub_file” )
    I have now modified that php programme to also write these two variables into a text file every time it executes.
    This shows that most times the two variables will concatenate to make a correct path, but on some occasions they do not. Below are some lines from that file.
    Can anyone suggest why “/$sub_file” would sometimes contain the full URL when it should only have the “tail”? And how to fix this?

    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /aioseo-redirects title:Redirects
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /aioseo-local-seo title:Local SEO
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /aioseo-seo-analysis title:SEO Analysis
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /aioseo-tools title:Tools
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /aioseo-feature-manager title:Feature Manager
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /aioseo-about title:About Us
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /https://aioseo.com/lite-upgrade/ title:<span class=”aioseo-menu-highlight”>Upgrade to Pro</span>
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /wp-mail-smtp title:Settings
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /wp-mail-smtp-logs title:Email Log
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /wp-mail-smtp-reports title:Email Reports
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /wp-mail-smtp-tools title:Tools
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /wp-mail-smtp-about title:About Us
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /monsterinsights_reports title:Reports
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /monsterinsights_settings title:Settings
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /https://www.mysite.com/wp-admin/admin.php title:Popular Posts
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /https://www.mysite.com/wp-admin/admin.php title:SEO
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /https://www.mysite.com/wp-admin/admin.php title:Tools
    C:\Inetpub\vhosts\mysite.com\httpdocs/wp-content/plugins + /https://www.mysite.com/wp-admin/admin.php title:<span style=”color:#1da867″> Addons</span>

    Thread Starter bobjgarrett

    (@bobjgarrett)

    Any suggestions on this?

    Plugin Author arnaudbroes

    (@arnaudbroes)

    Do you happen to have the full stack trace so that we can determine at which line in our plugin this error is occurring?

    Thread Starter bobjgarrett

    (@bobjgarrett)

    I have installed Query Monitor (is that the best way to get this info?) but have only now got:

    Warning	file_exists(): open_basedir restriction in effect. File(C:\Inetpub\vhosts\xxx\httpdocs/wp-content/plugins/https://aioseo.com/lite-upgrade/) is not within the allowed path(s): (C:/Inetpub/vhosts/xxx\;C:\Windows\Temp\;C:\Inetpub\vhosts\xxx\httpdocs)	1	
    wp-admin/menu-header.php:256
    file_exists()
    wp-admin/menu-header.php:256
    _wp_menu_output()
    wp-admin/menu-header.php:296
    WordPress core

    Does that help. I note that I have the same problem with two other plugins.

    Thread Starter bobjgarrett

    (@bobjgarrett)

    Further investigation suggests that this problem may be caused by the link you include to upgrade to Pro:
    https://aioseo.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=admin-bar

    Is that right? That having this protection in place means a continuous stream of errors becuase of this link?

    Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @bobjgarrett,

    Looking at the code, that seems to be the cause. I’ve opened an issue so that we can investigate this further and fix it in a future update. I’ll keep you on the loop.

    Hi @arnaudbroes ,
    I’m also facing the same issue due to that link.
    Did you find any solution?

    Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @soumick,

    We have put the issue on our roadmap but haven’t gotten around to fixing it yet. We’ll keep you posted though. In the meantime, you should be able to safely ignore it since it’s just a warning.

    Plugin Support Steve M

    (@wpsmort)

    Hi @bobjgarrett and @soumick,

    I wanted to let you know that we released All in One SEO version 4.2.3.1 today which fixes the open_basedir error you were seeing.

    If you’re still seeing an issue after updating to the latest version then please let us know.

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.