Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By alemoppo

Thread: Open_basedir restriction in effect. File is not within the allowed path

  1. #1
    migme is offline Junior Member
    Join Date
    Nov 2014
    Posts
    2

    Default Open_basedir restriction in effect. File is not within the allowed path

    My url is migme.altervista.org
    I have bought a code from codecaynon and installed on altervista.
    Installation went fine, after that when i go to index page it is showing error as this
    My code is in codeignetor.
    ErrorException
    realpath(): open_basedir restriction in effect. File(/var/www/html) is not within the allowed path(s): (/membri/migme/:/membri2/migme/:/membri/.dummy/) search →

  2. #2
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    678

    Default

    Quote Originally Posted by migme View Post
    realpath(): open_basedir restriction in effect. File(/var/www/html) is not within the allowed path(s)
    Your code is trying to access a folder that does not exist or to which it does not have the permissions.
    You can read/write only in your folder, which is: /membri/migme/.

    You should modify the script to use your folder.

    Bye!
    laravista likes this.

  3. #3
    migme is offline Junior Member
    Join Date
    Nov 2014
    Posts
    2

    Default

    I have updated the script in paths.php and got this error


    i'm getting this error when i load my page

    Fatal error: require(): Failed opening required '/membri/migme/app/Config/system/bootstrap.php' (include_path='.:') in /membri/migme/index.php on line 36
    the line 36 is
    $app = require rtrim($paths->systemDirectory, '/ ') . '/bootstrap.php';
    systemdirectory is
    public $systemDirectory = __DIR__ . '/system';
    appdirectory is
    public $appDirectory = __DIR__ . '/..';
    wrtiedirectory is
    public $writableDirectory = __DIR__ . '/writable';
    testdirectory is
    public $testsDirectory = __DIR__ . '/tests';
    viewdirectory is
    public $viewDirectory = __DIR__ . '/../Views';
    what i am doing wrong ?? it is codeignitor 4

  4. #4
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    678

    Default

    __DIR__ should be /membri/migme/.

    I see in the code
    Code:
    __DIR__/..
    or
    Code:
    __DIR__ . '/../Views'
    you can't read/write /membri or /membri/Views

    So you should set "$appDirectory" and "$viewDirectory" as subfolder of /membri/migme/

    Bye!
    Last edited by alemoppo; 11-23-2021 at 11:04 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO