Is it not possible to use cURL to access any domain except for the local domain?

Status
Not open for further replies.

it354example81

New Member
Messages
3
Reaction score
0
Points
0
I am trying to use the cURL library in PHP to access the following URL of a Flickr stream RSS feed:

http://api.flickr.com/services/feeds/photos_public.gne?id=39102179@N04&lang=en-us&format=rss_200

It's not working, and as I was searching the forums for an answer as to why this may be, I see that port 80 is blocked for free accounts. Does this mean that there is no way for me to use cURL for external domains?

Also, I saw one post where a user requested that a site be white-listed. If it is by default blocked, is this possible for flickr.com?
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Hello,

That information you found is old, we do not block outgoing connections anymore to the best of my knowledge.
Can you post the code you are trying to use as well as the exact error message you are receiving?
 

it354example81

New Member
Messages
3
Reaction score
0
Points
0
Thanks for the response! The simplest code that will lead to a 500 error is:

Code:
<?php

$ch = curl_init("http://api.flickr.com/services/feeds/photos_public.gne?id=39102179@N04&lang=en-us&format=rss_200");
$xml = curl_exec($ch);

?>

The exact error is:

500 Error
An internal server error has occurred. Please try your request again momentarily.
  • File or directory permissions are set too high: Files should be 0644, directories 0755.
  • Problem with your .htaccess file.
  • A syntax error in a CGI script.

I have set all file and folder permissions to the requirements (originally some files were left at the default 755 that is given when a new file is created). I haven't touched the .htaccess file and to my knowledge there are no syntax errors in CGI scripts.

When I replace the url that is being retrieved with that of a local file (eg. "./file.txt") it works fine.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
That code works fine on Chopin.

Could you go to Error Log in cPanel (not the one in File Manager) and see if there are any messages that might give a clue.
 

it354example81

New Member
Messages
3
Reaction score
0
Points
0
There are no errors there in the cPanel Error Log.

If it helps at all, the page that I'm trying to run the code on is http://it354ex.pcriot.com/index.php . I also tried creating a new page (test.php) and pasting the same code in it, with the same result. Currently, test.php is working because it is calling a local file ("./index.php") with cURL rather than the Flickr feed.

The server that my site is hosted on is boru.
 
Last edited:
Status
Not open for further replies.
Top