We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13943
    • 1 Posts
    I need open a xml file from another web in snippet. I am running into code that does not work in the snippets. Here is the code line that is giving the error:

    $file = "http://example.com/test.xml";
    
    fopen($file, "r");
    


    and here is the error that I get:

    « MODx Parse Error »MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	fopen() [function.fopen]: URL file-access is disabled in the server configuration	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/www/manager/includes/document.parser.class.inc.php(769) : eval()'d code	 
      Line: 	5	 
     
    Parser timing
      MySQL: 	0.0011 s	(6 Requests)
      PHP: 	0.0389 s	 
      Total: 	0.0400 s
    


    Where is the problem?
      • 4310
      • 2,310 Posts
      Error: fopen() [function.fopen]: URL file-access is disabled in the server configuration
      allow_url_fopen should be ON in PHP configuration (php.ini), you may need your host to do this if you can’t edit/access the php.ini file