We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3316
    • 28 Posts
    I have several sites on one server that all need to access the same .txt file using a TV. I’m using @File binding in a TV to form a drop down menu of several options. That way, I can update the one text file and it updates all the sites at the same time. Each site has it’s own root folder (separate domain names) but they all fall under the same client in my Apache setup.

    Unfortunately, when I access the page in the manager to use the drop down menu, it doesn’t show up. Rather, I get an error message:

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/clients/clientX/webXX/web/designThemes/designThemes.txt) is not within the allowed path(s): (/var/www/clients/clientX/webXX/web:/var/www/clients/clientXX/webXX/tmp:/var/www/user1.DOMAINNAME.com/web:/srv/www/user1.DOMAINNAME.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin) in /var/www/clients/clientXX/webXX/web/manager/includes/tmplvars.commands.inc.php on line 116

    Here’s what I have in my TV: @File /var/www/clients/clientX/webXX/web/designThemes/designThemes.txt

    (Note: the capital X’s above are numbers - I just didn’t want to show that info in case it’s a security risk)

    I can access this file if I change the file path to within the root of that particular website, but apparently modx won’t access it if it is outside the web root.

    I’ve also tried the full URL (ie http://mydomainname.com/path/to/file/designThemes.txt) but I get this error: Could not retrieve document ’http://mydomainname.com/path/to/file/designThemes.txt’.

    Please help!
      • 29019 ☆ A M B ☆
      • 104 Posts
      Just curious, but is there a reason you can’t access this file from a url, instead of a path? You mentioned that a lot of different sites are trying to access it, perhaps you could "publish" it on one of them, and use something like curl to read the file on the server side? Writing would be a bit more intricate of course, and if the file is at all sensitive this obviously wouldn’t work, but it might be a good alternative.
        www.darkstardesign.com

        Are you in the Nashville area? Join us for our next MODX meetup!
        • 3316
        • 28 Posts
        Got it! Thanks for the help! I noticed in my (ISPconfig3) control panel that there is a field for PHP open_basedir and so all I had to do was add in the location of the txt file and voila!