URL file-access is disabled

wordpress

#1

Firstly, i already did the basic search in this forum for this problem. Secondly i already try all the suggestions in the wiki http://wiki.dreamhost.com/index.php/Allow_url_fopen

until now i still get the error
Warning: file(): URL file-access is disabled in the server configuration

please help.


#2

We’ll obviously you didn’t do what the wiki said or you wouldn’t be getting this error. You can’t use fopen for external URLs. It just won’t work. You’ll have to do what the wiki says and convert it over to curl.

If you’re having troubles with that, then post some code, or links, or something! so we can actually help you.

–Matttail
art.googlies.net - personal website


#3

it is not external url…

How Michael from UK can earn $19000 a month from Internet.


#4

URL file access literally means you are trying to access a URL. URLs are preceeded by a protocol, such as http://. Even if that URL is your own, you will not be able to access it with things like the include() function if you use that method.

What is the code you are using that is throwing up the error?


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#5

the code is:
require_once(’/home/.foobar/techwebpress/www.urlname.com/dog/wp-config.php’);

How Michael from UK can earn $19000 a month from Internet.


#6

[quote]the code is:
require_once(’/home/.foobar/techwebpress/www.urlname.com/dog/wp-config.php’);[/quote]
If “dog” is a subfolder of your web root (in otherwords, you could connect to it with http://yourdomain.com/dog/), then you should change your function to read like this:

require_once($_SERVER['DOCUMENT_ROOT'].'/dog/wp-config.php');Let me know if you are still getting an error after you have done that.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#7

thanks for the help…but it still the same…:frowning:

How Michael from UK can earn $19000 a month from Internet.


#8

In that case, the error must be related to something else. Can you give me the URL so that I can see the error for myself?


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#9

here is the URL
http://www.typeabout.com/dog/wp_smartrss.php

==
How Michael from UK can earn $19000 a month from Internet.


#10

[quote]here is the URL
http://www.typeabout.com/dog/wp_smartrss.php[/quote]
Okay, that is a completely different problem. You are trying to use the file() function to call an external URL on line 29 of wp_smartrss.php. You will need to replace that section of the code with a cURL-based alternative.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#11

in my case, which one CURL code to use?
i attach the code here:

require_once($_SERVER[‘DOCUMENT_ROOT’].’/dog/wp-config.php’);

class SmartRss {
var $title;
var $link;
var $description;
function SmartRss ($aa)
{
foreach ($aa as $k=>$v)
$this->$k = $aa[$k];
}
}

function readDatabase($filename)
{
// read the XML database of aminoacids
$data = implode("", file($filename));

the first line has been changed according to the guide in the Wiki and the error now is stuck at line 29…which is the last line in the code i paste above…

please help…

==
How Michael from UK can earn $19000 a month from Internet.


#12

I think it will work if you replace line 29 with:

$ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $filename); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch);--------
Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#13

You know, I suspect I also have a problem with something that allow.url.fopen is honking, but I cannot for the life of me find a definitive list of what problem functions to look for! The wiki entry only mentions include, and then very much as an afterthought almost in passing, also mentions require. I’m guessing that means include_once and require_once are suspect. fopen is an obvious candidate. Just found file in going thru this thread. I’m going out of my mind trying to find more info on this option. I’ve googled for it, but most of the results simply point back to DreamHost’s original decision to disable it. OK OK, all well and good – NOW WHERE IS A LIST? I gather this was done a year ago, and the wiki entry still doesnt’ have anything more?

The very first suggestion in this thread should go in there. I did try that, though, and it doesn’s seem to solve my problem. I do see some odd init setting up stuff like so:

ini_set(“include_path”, ini_get(“include_path”) . PATH_SEPARATOR . $codesnippet_lib_path . PATH_SEPARATOR.$codesnippet_pear_path);
require_once(‘geshi.php’);

I commented out the ini_set and replaced the require once with: require_once($_SERVER[‘DOCUMENT_ROOT’].’/wordpress/wp-content/plugins/codesnippet/lib/geshi.php’);
(i’m sure there’s probably a bloginfo call i can use to pretty this up, but I just wanted to see if this touched on the problem)
but either there are more problems lurking in the code because I’m not knowing what else to search for, or that’s not sufficient. The error I get is a very generic:
[Wed May 24 19:55:42 2006] [error] [client 68.5.109.28] client denied by server configuration: /home/tittle/digitalramble.com/wordpress/wp-content/plugins/codesnippet/codesnippet.css
I’ve got a support ticket into dreamhost, but I cant’ stand waiting around to try and get something working.

I do a lot of web stuff, but I’m a Perl person, not a PHP, so…

Agh.


#14

Don’t think of it in terms of affected functions. Any PHP function that requires a remote (full) URL is going to be borked, and will need a cURL substitute. Making a list of affected functions isn’t really practical, because there are so many of them. Certainly, all the file system functions, and probably more besides.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]