Litespeed + PHP 5.3 + open_basedir + Silverstripe

Discussion in 'Install/Configuration' started by craigles, Mar 7, 2012.

  1. craigles

    craigles New Member

    Hi Everyone,

    Have a customer experiencing an issue with silverstripe in his account.

    When running under apache, the site loads without issue and is fine.
    However on switching to LS, the site no longer loads and throws out these sort of errors.

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/xxxx/public_html/.htaccess/_config.php) is not within the allowed path(s): (/home/xxxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/xxxx/public_html/sapphire/core/i18n.php on line 1739

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/xxxx/public_html/COPYING/_config.php) is not within the allowed path(s): (/home/xxxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/xxxx/public_html/sapphire/core/i18n.php on line 1739

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/xxxx/public_html/ChangeLog/_config.php) is not within the allowed path(s): (/home/xxxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/xxxx/public_html/sapphire/core/i18n.php on line 1739

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/xxxx/public_html/INSTALL/_config.php) is not within the allowed path(s): (/home/xxxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/xxxx/public_html/sapphire/core/i18n.php on line 1739

    Did some digging around on the silverstripe forums and found the following post:

    http://www.silverstripe.org/general-questions/show/15726

    Which seems to be the same issue we are experiencing.

    Does anybody know what I can do to get rid of these errors??

    Cheers,
    Craig
  2. mistwang

    mistwang LiteSpeed Staff

    It is a PHP internal bug regarding open_basedir, has nothing to do with LiteSpeed, remember that Apache suphp does not enforce open_basedir at all.
    You should report this bug to bug.php.net
    Also, should upgrade to the latest PHP 5.3.x release or downgrade to PHP 5.2.17 see if it helps or not.
    Another choice is to turn off open_basedir to match Apache suphp, we do not recommend this method as it is an extra layer of protection over suphp, good to have it.
  3. craigles

    craigles New Member

    Hi,

    Thanks for your reply.
    That's interesting to note, I had no idea that suPHP didn't enfoce the open_basedir restrictions on Apache - it answers a few questions i've always wondered about.

    Anyway moving back on topic, I've found the related bug at php.net - https://bugs.php.net/bug.php?id=44901

    Seems to be the exact issue to a tee, but it's been reported now since 2008 and if it hasn't had much movement since then - well im hesitant to think it's going to move much now.

    I think for the few customers who are using the silverstripe cms i'll just modify the code slightly so as to not treat every single entry in a directory as a directory, which appears to be what it is doing according to the errors from open_basedir.

    Cheers.
  4. mistwang

    mistwang LiteSpeed Staff

    I think changing silverstripe cms code is the correct way to fix this problem.
    Please post your fix to the PHP code or contribute the change back to silverstripe project if you do not mind, it will benefit to others.

Share This Page