Currency Converter: "URL file-access is disabled"


I have a currency converter running in a Flash based store that’s not currently working. I’m not sure how to go about solving this problem but when I run the PHP file directly, here are the error messages that I’m receiving:

[i]Warning: file() [function.file]: URL file-access is disabled in the server configuration in currency.php on line 13

Warning: file(http:///m5?a=1.00&t=&s=) [function.file]: failed to open stream: no suitable wrapper could be found in currency.php on line 13

Warning: join() [function.join]: Bad arguments. in currency.php on line 14

The code from the PHP file is as follows…


// $from var defined in cart_init
$from = $HTTP_POST_VARS[‘fromCurrency’];

// $to var defined in
$to = $HTTP_POST_VARS[‘toCurrency’];

// amount var defined in

$query_url = $HTTP_POST_VARS[‘query_url’];
$money[0] = join("",$money[0]);
$money[0] = ereg_replace(".

$money[0] = ereg_replace("
// get exchange rate
$money[0] = ereg_replace(".",’’,$money[0]);
$money[0] = ereg_replace(".

// get value conversion

echo $rString."&";

?> [/quote]

Thanks in advance to anyone who might be able to help out here… it would be greatly greatly appreciated.

That is a normal consequence of having allow_url_fopen disabled in PHP, which it is in the default Dreamhost configurations.

You should investigate modifying your code to use cURL, and explained in this Dreamhost Wiki article.

For further information about Dreamhost’s disabling of allow_url_fopen , search the forum for that term or check this Dreamhost wiki article on allow_url_fopen.


Ahhh… I see. Thank you kindly for pointing me in the right direction. I appreciate it very much. I’ll have a go with cURL and check back when I have some results.

No problem, I’m happy to help when I can. Good luck in your attempts at making the necessary changes. :slight_smile:


While you’re at it, you should change $HTTP_POST_VARS[‘whatever’] to $_POST[‘whatever’] as well. The former method was deprecated a good while ago, and will not be available at all in PHP6.

Simon’s website
Save $100 on 1-year plans with promo code [color=#CC0000]SCJESSEY100[/color] (details)