How to debug a problem if only the bot (google) requests a page?

My application throws Zend_Locale_Exceptionwhen calling from googlebot, where ZF sends the following error message:

Locale auto-detection failed!

The problem is probably that the locale is not set by default, but how can I debug it?

Since the google bot is not real-time, I need to actually fake the HTTP request that the bot makes, but how can I find out how this request is executed?

Attempting to send an Accept-Language header with curl will not produce an error:

   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, 'http://www.mysite.com.br/');
   curl_setopt($ch, CURLOPT_HEADER, true);
   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language'));
   echo $data = curl_exec($ch);
   curl_close($ch);

EDIT:

to clarify more:

  • I know that the problem is due to the lack of a default locale, but I need to debug this
  • , UA, - .
+3
4

- Google " Google". , , . phpinfo() , , , .

+3

:

  • , , , .

, application.ini:

resources.locale.default = "en_US"

, , , , , locale "" $this->bootstrap('locale'); /, Zend_Locale.

, Lynx, , , (, LANG, LANGUAGE).

+3

wget --user-agent "googlebot (at) googlebot.com User-Agent: Mozilla/5.0 (; Googlebot/2.1; + http://www.google.com/bot.html)" "http://www.mysite.com.br/"

+1

There are many reasons why you see an exception, so you cannot just “check” this. When you need to test a googlebot request, you must save the request so that it can later be played back on your web server.

However, as it is written, there can be many reasons why this is caused, you find autodetection in Locale.php.

+1
source

All Articles