Jump to content
The Uniform Server Community

Using include for URL acccess


jtlyles
 Share

Recommended Posts

Thanks for this wonderful piece of software, US has made my life much easier with such a simple testing server. However, I am trying to run the following php function to no avail.

 

<?php

include('http://waterdata.usgs.gov/nwis/current?format=rdb&site_no=01420500');

?>

 

Every time I try to run the include I receive a warning that states: "Warning: include() [function.include]: URL file-access is disabled in the server configuration in W:\www..."

 

I assume there is a way to enable this function in one of the configuration files, is it in the Apche or PHP configurations? Could someone please let me know where to look and what to change? Thanks.

 

James

Link to comment
Share on other sites

Open php.ini location: *\Uniform Server\udrive\usr\local\php

 

Located the following section (around line 505) and add the line shown in bold:

 

;;;;;;;;;;;;;;;;;;

; Fopen wrappers ;

;;;;;;;;;;;;;;;;;;

 

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.

allow_url_fopen = On

allow_url_include = 1

 

Note: When including external pages think about code Injection vulnerabilities!

 

All the best

Ric :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...