Hope that someone can help me out:
I'm testing out the script to see if it works, besides the fact that I had to make a workaround with mod_rewrite since I use nginx as webserver, I'm still esperiencing a strange problem even calling the translation script directly from /translate/index.php?engine=g&language=it&page=...
Before you go on please note: my website is adult-oreinted, so audience has been warned.
Let's answer to main questions, than desctive the problem by errorlog.log
The URL of the site you are translating
Latest Porn Videos Added Today - GoshTube.com is Bigger than YouPorn!
The URL to a copy of version.php running on your site (See the Troubleshooting Tips for a copy of this on-line program.)
No need for it isnce I own the whole box and I have root access, so I know that all needed stuff is in place (safe_mode=off, cURL, etc...)
Does the issue affect Google Translate, Yahoo Babelfish, or both?
Actually I'm interested in translating with google only, however I didn't check it with babelfish yet.
What hosting company is your web site hosted at?
HiVelocity Ventures, part of SagoNet, one of the best datacenters of USA
Which version of the Translation Script are you running? (Look at the top of translate/translate.php)
Didn't find any info about the version at the top of translate.php but I guess it's the latest since I downloaded the file lang-2009-09-23.zip
What version of Apache are you running? (1.3 or 2.x)
NginX here with FPM-CGI but this has nothing to do with the script since I can easily instruct it to rewrite whatever I want. I think the problem is in the script's PHP itself.
Does your Apache configuration have mod_rewrite enabled?
Again NginX has a different rewrite module, but no point for this question since I'm calling the file directly from the /translate path.
If you are calling the script from html files, is your Apache configured to support PHP code embedded in html files?
No .html on my website, just pure PHP.
Does your host support cURL?
Latest stable version
Is PHP safe_mode disabled on your host?
Again yes.
What HTML/JavaScript/PHP/etc... code are you using to call the script?
Direct link at the moment, that I'll configure it with mod_rewrite for nginx
What error messages are you seeing in your Apache server logs?
No error logs in NginX logs.
What error messages are you seeing when you try to translate a page?
Here follows the complete error log for a single page call:
Mon, 15 Feb 2010 11:23:49 -0500: Enter index.php: log_level=6
Mon, 15 Feb 2010 11:23:49 -0500: site_url=http://www.goshtube.com
Mon, 15 Feb 2010 11:23:49 -0500: hostname:
www.goshtube.com host:www
Mon, 15 Feb 2010 11:23:49 -0500: RemoveUrlParams()
Mon, 15 Feb 2010 11:23:49 -0500: base=
Mon, 15 Feb 2010 11:23:49 -0500: params=
Mon, 15 Feb 2010 11:23:49 -0500: new_params=
Mon, 15 Feb 2010 11:23:49 -0500: new_url=
Mon, 15 Feb 2010 11:23:49 -0500: page_id:it__ engine:g lang:it
Mon, 15 Feb 2010 11:23:49 -0500: url_mtime: 0 cache_mtime: 0
Mon, 15 Feb 2010 11:23:49 -0500: Updating cache for: g/it__
Mon, 15 Feb 2010 11:23:49 -0500: Translator url:
Google Translate
Mon, 15 Feb 2010 11:23:49 -0500: after curl_init
Mon, 15 Feb 2010 11:23:50 -0500: after curl_exec
Mon, 15 Feb 2010 11:23:50 -0500: REDIRECT message: translate_p_Frame, resource:
Google Translate
Mon, 15 Feb 2010 11:23:50 -0500: Translator url:
Google Translate
Mon, 15 Feb 2010 11:23:50 -0500: after curl_init
Mon, 15 Feb 2010 11:23:50 -0500: after curl_exec
Mon, 15 Feb 2010 11:23:50 -0500: REDIRECT message: MetaRefresh, resource:
Google Translate
Mon, 15 Feb 2010 11:23:50 -0500: Translator url:
Google Translate
Mon, 15 Feb 2010 11:23:50 -0500: after curl_init
Mon, 15 Feb 2010 11:23:52 -0500: after curl_exec
Mon, 15 Feb 2010 11:23:52 -0500: Content Check OK
Mon, 15 Feb 2010 11:23:52 -0500: No content after GoogleRemoveScripts
Mon, 15 Feb 2010 11:23:52 -0500: preg_last_error: 0(PREG_NO_ERROR)
Mon, 15 Feb 2010 11:23:52 -0500: No content after GoogleRemoveSpanWrappers
Mon, 15 Feb 2010 11:23:52 -0500: preg_last_error: 0(PREG_NO_ERROR)
Mon, 15 Feb 2010 11:23:52 -0500: No content at beginning of DefaultFixup
Mon, 15 Feb 2010 11:23:52 -0500: No content returned after fixup from 'http://translate.googleusercontent.com/translate_c?hl=en&sl=en&tl=it&u=http://www.goshtube.com/&prev=hp&rurl=translate.google.com&usg=ALkJrhjAfGG nvs4nE28iz7VbR9kFGazlpQ' for 'it__'
The real problem seems to be the preg_match function which finds an empty string while trying to modify the page to be outputted.
Just a couple quick notes:
- The page is obviously not outputted to /g since the string which generates it is empty.
- No chmod problems since the whole website is owned by the webserver user so the script can freely write wherever it wants (infact the script logs are saved).
- I'ts the 1st time I try to use this script and the 1st time my IP fetches content from google, so no chance to be banned. I tried to wget and curl some translated pages with my own custom script and and they both fetched the page with no problems.
So any clue on how to fix this?