Menu

#17 fopen configuration may prevent reading from HTTP

open
nobody
None
7
2007-03-07
2007-03-07
No

It is possible to set up PHP in order to disallow downloading files from Web using method fopen();

The solution is to use curl package methods.

Error message from my application:

"Warning: fopen(http://purl.org/jspetrak/profile-foaf) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /DISK2/WWW/zapisky.info/foaf-explorer/rdfapi/syntax/RdfParser.php on line 2160
RDF Parser: Could not open File: http://purl.org/jspetrak/profile-foaf. Stopped parsing."

Discussion

  • Josef Petrak

    Josef Petrak - 2007-03-07
    • priority: 5 --> 7
     
  • tomheath

    tomheath - 2007-10-13

    Logged In: YES
    user_id=1857680
    Originator: NO

    Yeah, agreed. The _http_get function is replicated in several places around the library. It would be useful to abstract this away into one common function, and make it configurable (in constants.php) to use fopen or curl depending on what the host has installed.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.