Welcome to WebmasterWorld Guest from 54.226.246.160

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Opening Local Files Vs Opening Remote Files

Using PHP's file();

     

Jeremy_H

5:56 pm on Dec 31, 2006 (gmt 0)

10+ Year Member



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

6:02 pm on Dec 31, 2006 (gmt 0)

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



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

6:34 pm on Dec 31, 2006 (gmt 0)

10+ Year Member



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

7:17 pm on Dec 31, 2006 (gmt 0)

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



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month