X
X
xuxubla2015-05-09 13:12:31
PHP
xuxubla, 2015-05-09 13:12:31

Why does a 500 Internal Privoxy Error pop up?

There is an online store parser:

<?php
set_time_limit(0);
$time1 = time();
include_once 'simple_html_dom.php';
$url='http://www.felix.ru';
//load mainpage
$html = new simple_html_dom();
$html -> load_file($url);
$category = [];
$subcategory = [];
$item = [];
foreach ($html -> find('a.Depth, a.Depth2') as $e) {
    $category[] = $url . $e->href;
}
$html->clear();
unset($html);
foreach ($category as $link) {
    $html = new simple_html_dom();
    $html -> load_file($link);
    foreach ($html -> find('div.CatalogList div.Version2 a[!style]') as $link1) {
        $subcategory[] = $url . $link1->href;
    }
}
foreach ($subcategory as $link) {
    $html = new simple_html_dom();
    $html -> load_file($link);
    do {
    $x = null;
    foreach ($html -> find('a.ItemLink') as $link) {
        $item[] = $url . $link1->href;
    }
    foreach ($html -> find('a.bigpage[plaintext=вперед]') as $a) {
        
        $a->href = str_replace('&amp;', '&', $a->href);
        $x = $a->plaintext;
        $html -> load_file('http://www.felix.ru' . $a->href);
    }
}
while ($x=='вперед');
}
var_dump ($item);
$time2 = time()-$time1;
echo '<br>' . $time2 . ' секунд';

It runs for exactly 5 minutes, then an error pops up:
500 Internal Privoxy Error
Privoxy encountered an error while processing your request:
Could not load template file connection-timeout or one of its included components.
Please contact your proxy administrator.
If you are the proxy administrator, please put the required file(s) in the (confdir)/templates directory. The location of the (confdir) directory is specified in the main Privoxy config file. (It's typically the Privoxy install directory).

If you partially lighten the code, everything works. Where to look for a problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xuxubla, 2015-05-12
@xuxubla

Privoxy is a personal proxy server. You need to find this wonderful program on your computer and set a larger socket-timeout value in the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question