However, I can't seem to connect to a remote FTP stream (not a local ftp server, but an outside one.):
- Code: Select all
Warning: file_get_contents(ftp://...@example.ca/home/username/example.html) [function.file-get-contents]: failed to open stream: No error in C:\xampplite\htdocs\test3.php on line 23
No error?!
The same thing happens with any of the stream creating functions - fopen, file, scandir, etc... HOWEVER, I can connect with the same username and password to the same server using ftp_connect and so on and ftp_get the file. (But I don't want to save it to my server; I want to put it in a variable.) This seems to be specific to the "stream"-type functions.
Has anyone else had this problem? For the longest time I thought I had done something wrong, but I've tried everything I could think of. (Including getting the new Xampplite! At least it's easy to install!) Any ideas? Any configuration things I need to change? I am behind a router, if it matters. I can connect using ftp_login with or without Passive mode, and my code (in this case) is simply:
- Code: Select all
print file_get_contents("ftp://username:password@example.ca/example.html");
Please help!