Discover Centmin Mod today
Register Now

Open_basedir issue with new XF related gallery

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Tracy Perry, Jul 24, 2015.

Tags:
  1. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    3:52 PM
    1.21.6
    MariaDB 10.3.36
    Was installing the new update to XenForo Gallery (the BETA) and this is what I got.
    I know it can be commented out in the php-pool?.conf and php.conf (or edited to include that path) but this may become an issue for others.


    Code:
    Admin Control Panel - Two Wheel Demons
    Server Error
    
    is_file(): open_basedir restriction in effect. File(/usr/local/sbin/php-fpm) is not within the allowed path(s): (/home/nginx/domains/twowheeldemon.com/public/:/usr/local/lib/php/:/tmp/)
    
    XenForo_Application::handlePhpError()
    is_file() in XenGallery/Model/Transcode.php at line 127
    XenGallery_Model_Transcode->findPhpExecutable() in XenGallery/Option/Transcoding.php at line 12
    XenGallery_Option_Transcoding::verifyOption()
    call_user_func_array() in XenForo/DataWriter/Option.php at line 346
    XenForo_DataWriter_Option->_validateOptionValuePreSave() in XenForo/DataWriter/Option.php at line 211
    XenForo_DataWriter_Option->_preSave() in XenForo/DataWriter.php at line 1446
    XenForo_DataWriter->preSave() in XenForo/DataWriter.php at line 1385
    XenForo_DataWriter->save() in XenForo/Model/Option.php at line 1131
    XenForo_Model_Option->importOptionsAddOnXml() in XenForo/Model/AddOn.php at line 324
    XenForo_Model_AddOn->importAddOnExtraDataFromXml() in XenForo/Model/AddOn.php at line 226
    XenForo_Model_AddOn->installAddOnXml() in ConvEss/Model/AddOn.php at line 24
    ConvEss_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
    XenForo_Model_AddOn->installAddOnXmlFromFile() in AddOnInstaller/ControllerAdmin/AddOn.php at line 32
    AddOnInstaller_ControllerAdmin_AddOn->actionInstallUpgrade() in XenForo/FrontController.php at line 347
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    XenForo_FrontController->run() in /home/nginx/domains/twowheeldemon.com/public/admin.php at line 13
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    6:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah @Matt ran into this for .08 betas

    In .08 beta 03, open_basedir is enabled for each nginx vhost via php.conf include line 9 centminmod/php.conf at 123.08beta03 · centminmod/centminmod · GitHub - you can comment it out or create a copy of php.conf include and use that copy without that line for that specific vhost.

    The new centminmod.com web site planned to coincide with .08 stable launch will have specific faq and note regarding open_basedir too :)

    edit:

    interesting about that path though usually it's directories for other stuff
     
    Last edited: Jul 24, 2015
  3. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    1:52 PM
    @Tracy Perry did the later versions of XFMG fix this?

    I just hit this migrating a XF 1.5 site to centminmod server--Tapatalk addon was hitting the open_basedir restriction. I disabled the open_basedir restriction, but it feels like a hacky solution. Filed an issue with tapatalk, so hopefully they can fix it.

    The weird thing is the stack trace says:
    Code:
    ErrorException: file_exists(): open_basedir restriction in effect. File(/home/nginx/domains/redacteddomain.com/library/XenForo/Model/UserTagging.php) is not within the allowed path(s): (/home/nginx/domains/redacteddomain.com/public/:/usr/local/lib/php/:/tmp/) - library/Tapatalk/Push/Push.php:459
    
    But the actual file path is /home/nginx/domains/redacteddomain.com/public/library/XenForo/Model/UserTagging.php Note the extra 'public'--I think this is the underlying cause of the error.

    There's a potential fix posted here: Posting issue on Xenforo 1.4.7 / Tapatalk 2.4.1 | Tapatalk - Community Chat & Support but it didn't work for me.
    Anyone have any idea why neither
    Code:
    SCRIPT_ROOT
    nor
    Code:
    XenForo_Application::getInstance()->getRootDir()
    are not generating the correct path?

    What's most perplexing to me is when I disable the open_basedir restriction, everything works fine, even though it's still using the wrong file path that misses the /public/... I'm guessing Nginx redirects it at some point in there to the correct location.
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    6:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no that is correct open_basedir is locked to vhost's web root which is public and below it but not above it. So that call to /home/nginx/domains/redacteddomain.com/public/library/XenForo/Model/UserTagging.php should be valid but looks like it's looking for /home/nginx/domains/redacteddomain.com/library/XenForo/Model/UserTagging.php without the public
     
  5. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    1:52 PM
    Yeah, I get that the open_basedir is working. I meant that the Tapatalk plugin for some reason isn't including the /public/.

    The part that has me wondering is why the variables 'SCRIPT_ROOT' and 'XenForo_Application::getInstance()->getRootDir()' seem to be returning the path to the root of '/home/nginx/domains/domain_name/' without the /public/--I wonder if there's a configuration issue somewhere that when 'SCRIPT_ROOT' is set, it's missing the /public/ part of the path.