I wrote a page for translation via Google Translate. When the $text reaches a
certain length, the Apache say: (OS 10054)An existing connection was
forcibly closed by the remote host.  : core_output_filter: writing data to
the network

Apache 2.2.11 PHP 5.2.9, 5.3rc1
Page charset : UTF-8


set_include_path('d:\httpd\library');

require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

$config = array(
    'adapter'    => 'Zend_Http_Client_Adapter_Proxy',
    'proxy_host' => 'localhost',
    'proxy_port' => 8081
);

$client = new Zend_Http_Client('http://translate.google.com/translate_a/t',
$config);
$text = 'Общая продолжительность рекламы на телевидении не может превышать
15 процентов времени вещания (9 минут в час). Такова норма действующего
законодательства. Но для городов с населением до 200 тысяч человек в скором
будущем ы';

$str = 'strlen = ' .  strlen($text) . '  mb_len = ' . mb_strlen($text,
'utf-8');
file_put_contents(dirname(__FILE__) . '/debug.log', $text . "\r\n" . $str .
"\r\n", FILE_APPEND);

$client->setParameterGet('client', 't');
$client->setParameterGet('text', $text);
$client->setParameterGet('sl', 'ru');
$client->setParameterGet('tl', 'uk');

$client->setHeaders(array(
    'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru;
rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3',
        'Accept' => 'text/html',
        'Accept-Charset' => 'windows-1251,utf-8'));


$response = $client->request();



-- 
View this message in context: 
http://www.nabble.com/Zend_Http_Client-kill-apache-tp22821783p22821783.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to