Support » Plugin: Wordfence Security - Firewall & Malware Scan » open_basedir restriction in wordfence

  • Resolved sjebelli

    (@sjebelli)


    Hi,

    I have this issue with wordfence and this cause my site to fatally crash (blank white page). so i debugged the wordpress and here is result:

    NOTE: my site is userB.com

    Warning: file_exists(): open_basedir restriction in effect. File(/home/userA/domains/domainA.com/public_html/wp-content/plugins/wordfence/vendor/composer/../geoip2/geoip2/src/Database/Reader.php) is not within the allowed path(s): (/home/userB/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php56/lib/php/) in /home/userB/domains/userB.com/public_html/wp-content/plugins/wordfence/vendor/composer/ClassLoader.php on line 384

    Fatal error: Class ‘GeoIp2\Database\Reader’ not found in /home/userB/domains/userB.com/public_html/wp-content/plugins/wordfence/models/common/wfGeoIP2.php on line 28

    it seems that composer try to load resources form outside the host directory. but why??

    I tried reinstall the plugin, worked a day but error happened again…

    any help?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @sjebelli,
    Good question. That is quite unusual behavior. As far as I can tell that absolute root path is fetched like this:

    dirname(dirname(__FILE__))

    So the question would be why your site suddenly starts returning an incorrect value for the dirname PHP function and the FILE constant. I think it would be best to reach out to your web host about this as they would be better equipped to answer that specific question.

    EDIT: One thing they may want to look in to is if it could possibly be caused by a misbehaving opcache. In this case restarting Apache would fix it (until it happens again).

    • This reply was modified 1 year, 4 months ago by wfasa.
    • This reply was modified 1 year, 4 months ago by wfasa.

    Hi,
    i discovered that this error occurred for lots of websites. here is an example in your forum.

    I think what @iragination said in link above is important. one other thing is that after I deleted the plugin files and reinstall wordfence, my site works fine. but later, exactly on next Thursday, the site will crash! my website crashed again today… for 3rd Thursday in a row! What task is scheduled on Thursdays? any update? any use of Class ‘GeoIp2\Database\Reader’?

    I think you guys should update the plugin with a patch to fix this bug. this is not a minor host issue…

    Hi @sjebelli,
    Are you sure those are the same though? In your case it’s failing to load a file due to the incorrect root path being used. For those in the other thread, the issue is that they are already using composer for something else and there is some conflict between the autoloaders.

    @wfasa

    Yes I’m sure. please read highlighted data:
    ———————–
    Warning: file_exists(): open_basedir restriction in effect. File(/home/HOST-A/domains/domain-a.com/public_html/wp-content/plugins/wordfence/vendor/composer/../geoip2/geoip2/src/Database/Reader.php) is not within the allowed path(s): (/home/HOST-B/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php56/lib/php/) in /home/HOST-B/domains/domain-b.com/public_html/wp-content/plugins/wordfence/vendor/composer/ClassLoader.php on line 384

    Fatal error: Class ‘GeoIp2\Database\Reader’ not found in /home/HOST-B/domains/domain-b.com/public_html/wp-content/plugins/wordfence/models/common/wfGeoIP2.php on line 28
    ———————-

    Even the same class:GeoIp2\Database\Reader has the problem. in other thread, several people had this error.

    • This reply was modified 1 year, 4 months ago by sjebelli.

    Hi again,
    I understand that they are similar in that they are failing to load the same class. But you have an open basedir restriction and a different root path.

    In the other thread, the issue was that they had several installations of composer. Do you have other instances of composer?

    If you are not aware of any, have you tried deactivating all other plugins to see if the issue is still the same?

    Plugin Support wfdave

    (@wfdave)

    Hi @sjebelli,

    We haven’t heard back from you in a while so I’ve gone ahead and marked this thread as resolved.

    if you’re still having issues with Wordfence, please feel free to open another thread.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘open_basedir restriction in wordfence’ is closed to new replies.