homepage Welcome to WebmasterWorld Guest from 54.145.182.50
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Opening Local Files Vs Opening Remote Files
Using PHP's file();
Jeremy_H

5+ Year Member



 
Msg#: 3204513 posted 5:56 pm on Dec 31, 2006 (gmt 0)

Hello,

I'm trying to open a file in a script.

The file I'm trying to open is a .csv and is located on another website.

If I use:
$date=file("http://www.exampe.com/file.csv");
I get a URL file-access is disabled error.

If I open the file myself, save it to my site, and use:
$date=file("file.csv");
The data works just fine.

Is the error I'm getting based on how my website is configured, or based on how the other website is configured.

Thanks

 

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3204513 posted 6:02 pm on Dec 31, 2006 (gmt 0)

Can you give the specific error?

It appears that your server does not have permissions to access theirs, in which case the problem resides on their end, but it may not be a problem at all...for them ;)

Jeremy_H

5+ Year Member



 
Msg#: 3204513 posted 6:34 pm on Dec 31, 2006 (gmt 0)

Thanks for the reply,

The specific error I'm getting is this:

Warning: file(): URL file-access is disabled in the server configuration in X.php on line Y

Warning: file(http://www.exampe.com/file.csv): failed to open stream: no suitable wrapper could be found in X.php on line Y

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3204513 posted 7:17 pm on Dec 31, 2006 (gmt 0)

Actually it may be your configuration. Check allow_url_fopen [us3.php.net] to make sure that it is enabled in your php.ini file.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved