Web Hosting Talk







View Full Version : Error with PageRank script


dereklowe
10-02-2005, 10:51 AM
Hey, im tryin to make a quick PageRank checker website, and i downloaded a php script of it on hotscripts.com but whenever i upload it i get this error message:
bonafideimg . com/uploads/error1.txt

this is the scripts contents:
bonafideimg . com/uploads/error2.txt

Any help is very appriciated, thanks!

sea otter
10-02-2005, 11:25 AM
Sorry, but I don't understand the problem.

You've got a script, let's say pagerank.php

I assume the php file contains code, and not the words "bonafideimg . com....." or whatever.

How are you uploading it to your site? With an FTP program? via CPanel?

Does the script upload ok?

Where in this process are you getting the error?

With a little more info, I'm sure I --or others-- could help!

dereklowe
10-02-2005, 12:05 PM
Ok basically, i got the script from hotscripts.com this url infact:
http://scripts-templates.com/demos/pr/pagerank.php

I'm using it on:
http://69.61.55.106/~bonpr/index.php

When you type a url into the field, it comes up with this error message:
Warning: file(http://www.google.com/search?client=navclient-auto&ch=6-1899198126&features=Rank&q=info:webhostingtalk.com):
failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/bonpr/domains/bonafidepr.com/public_html/pagerank.php on line 86

I do not know why i am getting this error message as i am not a php coder at all, even after checking line 86.

The script itself is located here:
http://www.bonafideimg.com/uploads/error2.txt

Posted in a txt message so you can see the whole code because it is quite big.

There is no problems uploading it via ftp.

jimlundeen
10-02-2005, 01:57 PM
is the script downloading a remote page? if so, check the permissions of the directory it;s trying to download to. likely you don't have it set to allow apache (or whatever use your web server runs as) to write to the directory.

jimlundeen
10-02-2005, 02:00 PM
...i just tried using your script. did you try manually going to the URL it's trying to read from?

http://www.google.com/search?client=navclient-auto&ch=6-2147439755&features=Rank&q=info:jimlundeen.com

I get a 403 error when I go there manually. Give it a shot, and read the page that comes up. That will probably give you some more info as to what to try next.

dereklowe
10-02-2005, 02:14 PM
I didint try it manually, i done it via the form on:
http://69.61.55.106/~bonpr/index.php

I did try to chom'd the file to 777 etc but it did not work eighter.

sea otter
10-02-2005, 02:17 PM
Originally posted by dereklowe
Ok basically, i got the script from hotscripts.com this url infact:
http://scripts-templates.com/demos/pr/pagerank.php


Yeah, that's the standard page rank script floatin' around out there.

As Jim said, you can always check the page by hand (or using curl or file() in php) to see if it loads.

Also -- make sure that allow_url_fopen is set to on in php.ini

you can check that by calling phpinfo() and then searching for "allow_url_fopen" in the returned data.

I've sometimes seen consistent 403's when it's not set.

dereklowe
10-02-2005, 02:23 PM
Yea it's set to on.

If no one knows how to fix this problem, anyone know where i can get another script?

sea otter
10-02-2005, 02:26 PM
The one I have might be different. I'll compare them and see. I'll also upload yours to my host and try to hit the page you're having trouble with.

jimlundeen
10-02-2005, 03:45 PM
I don't think it's your script. Did you follow the link by hand and read the page that comes up on the Google site?

dereklowe
10-02-2005, 03:53 PM
You see, it gives google error with url when typed in by hand, it comes up with error when submited in form on my site.

But when you do it from the form on:
http://scripts-templates.com/demos/pr/pagerank.php

It works! And i got no clue why.

jimlundeen
10-02-2005, 04:37 PM
my guess is that Google requires some sort of authorization to use that particular type of access to their site. scripts-templates.com must have already obtained that authorization. the error message talks about not being allowed from a certain IP address, which is what leads me to believe it's a prior-authorization type of situation.

Lebanon
10-02-2005, 05:03 PM
actually sea otter has answered ur question and you kept searching for another answer ,
Its the url fopen setting , as for jimlundeen, most google requests requires google api auth key, such as custom google query fetching or so but this one does not require it.
All you need is a php enabled webserver with fopen .

sea otter
10-02-2005, 10:43 PM
I've also seen that error when the magic number crc submitted to google (and calculated by the script) is wrong. That happened for me consistently when I ran my pr script LOCALLY (e.g. on apache on localhost), but worked fine online.

Anyhow, my pr script is up at http://consolidatedsites.com/pr.php

Go give it a quick whirl and see if it works for you. If so, I can send you the script.

sea otter
10-03-2005, 02:22 AM
okay,

I uploaded your script to my site at

http://consolidatedsites.com/prderek.php

And it works fine.

Seems like the problem is on your host's end.

Can you put up a phpinfo page and let me look at the results?

FYI, my account is a shared hosting account with asmallorange.com on a server at The Planet.

sea otter
10-03-2005, 03:17 AM
Ooops, past the 15 minute edit mark.

Forgot to say last message that Lebanon's right.

dereklowe
10-03-2005, 03:23 AM
Hey

http://69.61.55.106/~bonpr/report-php.php

Thats the phpinfo page.

Thanks

sea otter
10-03-2005, 03:26 AM
k, i'll poke around and see what i can see.

sea otter
10-03-2005, 05:43 AM
well,

It seems that your setup hast these (and maybe other) functions disabled:

dl,exec,shell_exec,passthru,proc_open,proc_close,system,chmod,chgrp,popen,ini_alter,chown


My *guess* is that disabling proc_open or popen or passthru has interfered with read()'s ability to work "behind the scenes" at opening, retrieving, and processing a URL-based "file".

If you control your own php.ini, you might want to (briefly) enable ALL the disabled function calls, run a quick test, and see what happens. Or, if you're technically capable, you could replace the file() call with curl() calls (a little more tedious to set up and use), but I do see that you have curl enabled.

Hope that helps, because otherwise, I'm stumped! :(

NOTE: I disabled the pr scripts that I mentioned above because I'm not (yet) ready for people to use them! If you want me to turn them back on for you for testing purposes, let me know.

dereklowe
10-09-2005, 10:05 AM
Right so..

I emailed my host and after a few days they said they disabled some functions and stuff but could not get the script working. They then said it must be because a url:
http://www.google.com/search?client=navclient-auto&ch=6-2147439755&features=Rank&q=info:ign.com


Is blocked or something, but i told them it's not because other ppl use the exact same script and it works for them!

Has anyone got any ideas at all?

sea otter
10-09-2005, 10:14 AM
Well, just to be sure I just re-enabled and reran your script on my site, put in ign.com, and sure enough PR 7/10 comes back (confirmed as the same value from a few other PR sites as well).

So now I really am stumped.

Who is your host? If you'd rather PM me the info, that's fine too.

dereklowe
10-09-2005, 11:35 AM
This is so strange.

Anyways, my host is gate2vn.net

sea otter
10-09-2005, 11:42 AM
k, I'll see if I can find anything out.

HM2K
09-14-2006, 01:04 PM
Sorry to bring up such an old topic, however i'm having similar trouble and wanted to know if you had resolved the problem.

I've detailed my findings so far here: http://www.googlecommunity.com/about14098.html

This is the site of the original pagerank.php script.