1.6.6a failed to open stream errors

Problems with the Windows version of XAMPP, questions, comments, and anything related.

1.6.6a failed to open stream errors

Postby vincentrich » 23. March 2008 14:47

I am getting failed to open stream errors from all my file() functions and other related functions. It was fine before I upgraded.

Any idea what is causing this problem?
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore

Postby Wiedmann » 23. March 2008 15:45

I am getting failed to open stream errors- Any idea what is causing this problem?

You have an error in your code.

(Nothing more to say, wihout the original error message, and a code sample...)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby vincentrich » 23. March 2008 15:55

Code: Select all
#INITIALISE DELICIOUS ADD POST API CALL
   $delicious_api_call = "https://" . $username . ":" . $password . "@api.del.icio.us/v1/posts/add?url=$url&description=$description&tags=$tags";
   
   #LAUNCH DELICIOUS ADD POST API CALL
   $result = file("$delicious_api_call");


This is my code. It used to work on my previous XAMPP version 1.6.2.
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore

Postby vincentrich » 23. March 2008 15:56

The URL in the variable above works if I enter it into a browser.
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore

Postby Wiedmann » 23. March 2008 16:09

The complete error message?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby vincentrich » 23. March 2008 16:18

Code: Select all
Warning: file(https://...@api.del.icio.us/v1/posts/add?url=http://www.domain.com/) [function.file]: failed to open stream: No error in C:\Projects\functions.php on line 342
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore

Postby vincentrich » 23. March 2008 16:19

No idea why the URL works in the browser but PHP cannot find it. file_exists returns nothing.
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore

Postby vincentrich » 24. March 2008 03:18

I put the URL in an Iframe and it works. I have no idea why the PHP file function refuses to work.
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore

Postby vincentrich » 24. March 2008 04:19

Code: Select all
#THIS FUNCTION RETRIEVES THE CONTENTS OF A FILE WHEN FOPEN/FILE FUNCTION FAILS
function get_content($url)
{
   #OPEN CURL SESSION
   $handle = curl_init();
   
   #CURL SETTINGS
   curl_setopt($handle, CURLOPT_URL, $url);
   curl_setopt($handle, CURLOPT_HEADER, 0);
   curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
   
   #OUTPUT BUFFERING START
   ob_start();
   
   #EXECUTE CURL COMMAND
   curl_exec($handle);
   
   #CLOSE CURL SESSION
   curl_close($handle);
   
   #RETRIEVE URL CONTENTS
   $string = ob_get_contents();
   
   #OUTPUT BUFFERING END
   ob_end_clean();
   
   return $string;
}


I tried to use curl instead of file() and it worked only after I added:

Code: Select all
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);


I was trying to load a https URL so the code above was necessary.
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 92 guests