NetBuilders

You are welcome to look around. You will have to register before you can post a message, create a blog, chat live with our members, or add a site to our directory.




Reply Learn SEO from Aaron Wall
Old 14 December, 2008, 08:44 AM   #1 (permalink)
Gozer
 
Will.Spencer's Avatar
 
Location: Singapore
iTrader: (45)
Blog Entries: 1
Thanked 1,618 Times in 890 Posts
Posts: 4,948
$NetBucks: 8,214
Join Date: Dec 2008
Last Online: Today 01:46 AM
Default Translation Script Troubleshooting Tips

Check your PHP Configuration

Create a file called version.php on your web site with the following code in it:
Code:
<?php phpinfo(); ?>
Load this page in your web browser to set details of your PHP configuration.

The Translation Script requires safe_mode to be set to off and it requires cURL support to be enabled.

Enable Debugging Options in translate/tr_config.php

tr_config.php has two options for debugging:

Code:
$params['write_raw_content'] = 0; //writes data received from translator server for debuggging purposes
This saves .RAW files in your cache directories. These files are the raw data that we get back from the translation engines, before any fixups are applied. These files take up a lot of space; Don't leave this enabled unless you need it. This is useful for debugging the content of translated pages.

Code:
$print_error_text = 0;  //Control the printing of error text (0/1)
This enables enhanced error messages on translation failures. This can be very useful when translations are not working. Your site visitors can see these messages also, so it's best not to leave this enabled.

Enable Logging Options in translate/tr_config.php

The script has many levels of error logging. These are configured by setting the log_level variable in the file translate/tr_config.php.
Code:
$log_level = TRLOG_DEBUG;  //logging level (LOG_NEVER,LOG_ERROR,LOG_WARN,LOG_INFO,LOG_DEBUG,LOG_TRACE)
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir

This error message usually means that PHP safe_mode is enabled. If you are the admin of your server, disable safe_mode. If you are not the admin, as the admin (usually your hosting company) to disable safe_mode. If they refuse, look for a more responsive hosting company.

We are experiencing a temporary problem with the foreign language section. Please try again later. We apologize for the inconvenience.
Scuzi / Perdon / Pardon / Das is Nicht Gud / Sori / Nay canne doo tha laddy

This error usually means that the script is working, but you've overloaded the translation servers and they've blocked your web servers IP address.

This can happen a lot before you fill your translation cache.

You can get more information about this error by enabling $print_error_text as described above.

What To Do If You are Blocked by Google Translate

If you send too many requests too quickly to Google Translate, the IP address of your server will be blocked.

To reduce the number of requests you send to Google Translate, increase the $translator_cache_days variable in translate/tr_config.php.

Once your servers IP is blocked, it normally only stays blocked for a few days. You will have to wait it out or switch the outbound IP address of your server.

What To Do If You are Blocked by Yahoo Babelfish

Yahoo uses IP addresses instead of DNS entries in a lot of their Babelfish code. These IP addresses change, depending upon what part of the world your web server is in. If Yahoo Babelfish isn't working for you, you may have to change the Babelfish IP address listed in translate/translate.php.

In addition, Yahoo has also sometimes blocked requests coming from the same IP address as the web site where the pages are served. A web server with one IP address will use that IP address for incoming (web) traffic and outgoing (translation) traffic. Yahoo Babelfish translation may not work at all on a web server with one IP address. If your web server has two or more IP addresses, you can use the primary IP address as the outgoing IP address and publish another IP address at the incoming IP address.

Enabling Debugging for Apache mod_rewrite

Some translation script issues are the result of issues with mod_rewite. It is possible to enable enhanced mod_rewrite logging by placing the following lines in the Apache configuration for your vhost:
RewriteLog "location_where_you_want_the_rewrite_log_store d"
RewriteLogLevel 9

Last edited by Will.Spencer; 25 April, 2009 at 00:23 AM..
  Reply With Quote
Old 23 October, 2009, 16:52 PM   #2 (permalink)
Unknown Net Builder
 
iTrader: (0)
Thanked 0 Times in 0 Posts
Posts: 5
$NetBucks: 14
Join Date: Oct 2009
Last Online: 20 November, 2009 12:12 PM
Default

Quote:
Originally Posted by Will.Spencer View Post

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir

This error message usually means that PHP safe_mode is enabled. If you are the admin of your server, disable safe_mode. If you are not the admin, as the admin (usually your hosting company) to disable safe_mode. If they refuse, look for a more responsive hosting company.
No need too change the hosting company if you got this warning. You can simply mute the waring by prefixing the curl_setopt call with an '@'like this:

Around line 57 :
Code:
//submit the translation request
        $ch = curl_init();
        logger(TRLOG_TRACE,"after curl_init");
        @curl_setopt($ch, CURLOPT_URL, $resource);
        @curl_setopt($ch, CURLOPT_PROXY, $translate_proxy);
        @curl_setopt($ch, CURLOPT_HEADER, 0);
        @curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // Return into a variable
        @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 
        @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        @curl_setopt($ch, CURLOPT_USERAGENT, $params['user_agent']);
It works great for me.

By the way, thank you for this great script .

PS : Sorry for my bad english
  Reply With Quote
Reply

Bookmarks

Tags
script, tips, translation, troubleshooting


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Translation Script Version 2.15 Will.Spencer Translation Script Support 9 15 April, 2009 09:15 AM
Need help with this Translation Script! coder77 Translation Script Support 1 26 February, 2009 20:05 PM


All times are GMT. The time now is 03:14 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.1
vBAdvertise v1.0.0 Copyright ©2009, PixelFX Studios
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios