open_basedir restriction in effect. File is not within the allowed paths

Home Forums BulletProof Security Pro open_basedir restriction in effect. File is not within the allowed paths

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23011
    Glasairmell
    Participant

    Hi,

    In trouble shooting another problem I came across this when I tested my bps_php_error.log. I have Open BaseDir turned on for all sites.  Any suggestions please = ) ?

    [24-May-2015 20:46:18 UTC] PHP Warning:  copy(): open_basedir restriction in effect. File() is not within the allowed path(s): (/home/xxx/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php55/lib/php/) in /home/xxxx/domains/xxx.com/public_html/wp-content/plugins/bulletproof-security/admin/php/php-options.php on line 1546

    Cheers!

    #23014
    AITpro Admin
    Keymaster

    The php error message is very clear.  You would need to add the correct path to the open_basedir directive paths. I believe that would be: /home/xxxx/domains/xxx.com/public_html/ but do not quote me on that and check with your web host about that. I do not use open_basedir.

    #23015
    Glasairmell
    Participant

    Since I am the host I will figure it out.  Just wanted to make sure it was not a something I had to set in BPS pro.  Thank you!  Bulletproof-security plugin seems to be looking for files outside the user directory.  Could this be the case?

    #23017
    AITpro Admin
    Keymaster

    Oh ok then I believe the path is this:  /root-path-up-to/your-user-account-name/:  If you are allowing everything within /your-user-account-name/ then that should take care of it. Or if that does work not then use the /full-path-to/public_html/. Nope it is simply that open_basedir just needs to be configured with the correct user account name folder/path.

    #31279
    AITpro Admin
    Keymaster

    Email Question:
    Hi, running with php 7.0.12 now on centos 6.8 without problems. Its an amazing speed boost in compare to php 5.6 🙂
    Only in the BPS error Log i get this warning:

    [BPS Pro htaccess Protected Secure PHP Error Log]
    [29-Oct-2016 08:53:56 UTC] PHP Warning:  copy(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/vhosts/xxxxx/:/tmp/) in /var/www/vhosts/xxxxx/httpdocs/vz01pro1/wp-content/plugins/bulletproof-security/admin/php/php-options.php on line 1676
    
    [29-Oct-2016 08:56:05 UTC] PHP Warning:  copy(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/vhosts/xxxxx/:/tmp/) in /var/www/vhosts/xxxxx/httpdocs/vz01pro1/wp-content/plugins/bulletproof-security/admin/php/php-options.php on line 1676

    The Open Basedir settings are the same like in php 5.33 and php 5.6. Have you maybe an idea?

    Answer|Solution:
    Yep, we have PHP7 installed on our local development server and it is amazingly fast.  Our host only has up to 5.4 available, but we compensate by doing other things to speed up performance.  😉

    You would just need to add the path to the hosting folder that you want to allow open_basedir to be able to read and write to.
    I believe that would be:  /var/www/vhosts/xxxxx/httpdocs/

    Currently you are only allowing open_basedir in these folders:  (/var/www/vhosts/xxxxx/ and /tmp/ You will need to open and edit your php.ini file and add either that additional path or change the existing path.

    Example: open_basedir = "/var/www/vhosts/xxxxx/:/var/www/vhosts/xxxxx/httpdocs/:/tmp/"

    #40978
    Grant
    Participant

    Hello,

    I am getting a similar error but it seems to be linked to the WP Super Cache plugin:

    PHP Warning: file_exists(): open_basedir restriction in effect. File(/wp-cache-xh26030fb48e66db61f46060a402043325.php) is not within the allowed path(s): (/usr/www/wwws/users/iafridzcgy:/usr/wwws/users/iafridzcgy:/usr/www/users/iafridzcgy:/usr/home/iafridzcgy:/usr/local/rmagic:/usr/share/php:/usr/local/lib/php:/tmp:/usr/bin:/usr/local/bin:/usr/local/share/www:/usr/www/share/www:/usr/share/misc:/dev/urandom:/var/www/php_profiler/xhgui) in /usr/www/users/iafridzcgy/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 100

    I have contacted the WP Super Cache developer but please let me know if you have any insights or suggestions.

    Thank you,

    Grant

    #40979
    AITpro Admin
    Keymaster

    @ Grant – I believe you want to use this open_basedir setting:  open_basedir = /usr/www/users/iafridzcgy/:/tmp/ in your php.ini file. I think you are blocking PHP from being able to process custom php.ini files as well with your existing open_basedir path settings. After editing your php.ini file reboot your server if you have root permissions to your server.

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