Wednesday, June 23, 2010

Need to solve error in PHP code useful for getting Google PageRank

We are working on to get Google pagerank using php code for one of our customer projects.

I referred this webpage for doing this.

This code works fine in our local machine. We are using it for long time from our local machine. And, we tried to use it in our server few months back. But it didn't work in our server since fsockopen is not enabled in our server.

But, today this code didn't work in our customer's server even when fsockopen is enabled in their server.

During debugging I came to know that Google returns "Your client does not have permission..." error message.

I have gone thro' many forums to know more about this issue.

But it seems there is no solid answer for this issue. Everyone is having different experience/opinion with this issue.

For example, some people are saying that Google might have banned the IP of the server if any other domain hosted on the same IP had misused Google's services.

Some are saying that it works in some verison of php and doesn't work in some other version.

Incorrect ch parameter generation due to bitwise operator issue is another reason stated by few people.

And, suggestion of using USER_AGENT in cURL request for mimicking as actual browser request is rejected by some others who say Google won't encourage by saying that the Pagerank request should be originated from the server or not from the client browser. (Request from Actual Browser Toolbar is different).

I couldn't understand this issue clearly. If you know more about this you can share thro' comments.

Update on June 25
It seems this issue is related to the different behaviour of php in 32 bit machines and 64 bit machines.
This issue is solved by using the php code specific to 64 machines.

More Articles...
You can bookmark this blog for further reading, or you can subscribe to our blog feed.

No comments:

Search This Blog