We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8522
    • 145 Posts
    I have a fresh and an updated (from 1.0.2) install of modx 1.0.3. the updated is on a subdomain, and the fershly istalled on a temporary path (mydomain.com.server.hostingcompany.com)

    Both have same error, TinyMCE’s mcpuk browser throws an error

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/httpd/vhosts/mydomain.eu/httpdocsassets/plugins/seturl_js_tinymce.inc) is not within the allowed path(s): (/home/httpd/vhosts/mydomain.eu/httpdocs:/tmp:/usr/share/pear:/usr/bin:..:../..) in /home/httpd/vhosts/mydomain.eu/httpdocs/manager/media/browser/mcpuk/browser.php on line 17



    note it writes: httpdocsassets
    should be: httpdocs/assets


    it seems to be fixed with adding "/" on line 17 of file:
    manager/media/browser/mcpuk/browser.php

    from
    $seturl_js_path = MODX_BASE_PATH . ’assets/plugins/’;

    to
    $seturl_js_path = MODX_BASE_PATH . ’/assets/plugins/’;
      • 8522
      • 145 Posts
        • 33014 ☆ A M B ☆
        • 1,231 Posts
        A slash should point out MODX_BASE_PATH at the end.
        Please try this.

        config.inc.php line 40
        $base_path= $pth . (substr($pth, -1) != "/" && substr($pth, -1) != "\\" ? "/" : "");


        ->
        $base_path= rtrim($pth, '/\\') . '/';


          • 8522
          • 145 Posts
          Hello Yama

          Thank you so much for looking into this!

          I found that MODX_BASE_PATH is set in modx, correctly with a slash at the end.

          And browser.php is overwriteing MODX_BASE_PATH with
          define(’MODX_BASE_PATH’, realpath(’../../../../’)); 

          That for I opened a new issue http://svn.modxcms.com/jira/browse/TINYMCE-58

          regards
          eni
            • 8522
            • 145 Posts
            Is anyone else having this issue?
              • 33014 ☆ A M B ☆
              • 1,231 Posts
              define('MODX_BASE_PATH', realpath('../../../../'));


              try replace this.
              include_once('../../../includes/config.inc.php');

                • 8522
                • 145 Posts
                Quote from: yama at May 07, 2010, 06:02 PM

                try replace this.
                include_once('../../../includes/config.inc.php');

                Does this work for you?

                At this point my prefered solution is to just comment the line, since it is not needed.
                // define('MODX_BASE_PATH', realpath('../../../../'));
                  • 22843
                  • 5 Posts
                  Hmmm, I’ve just stumbled onto this particular error myself; eerne’s comment-it-out solution seems to have worked, but is this the sort of hack that’s going to need to be redone after future upgrades? Or worse still, cause future upgrades to go awry? I’m always a bit nervous of kludging around in core files, y’see... had a few nasty surprises when I was first getting to grips with Wordpress. smiley