Всем привет. У меня вот такая беда, парсер вытаскивает результаты матчей со спортивного сайта. Всё работает вроде бы нормально, результат записывается в файл, но файл больше 100кб не создается. В php.ini post_max_size = 30M upload_max_filesize = 30M nginx.conf client_max_body_size 10m; client_body_buffer_size 128k; proxy_buffer_size 4k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; то-есть вроде-бы всё ок. вот сама функция Код (Text): function get_web_page( $url, $bot ) { $uagent = array( "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)", "Mozilla/5.0 (compatible; Mail.RU/2.0)", "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)", "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0" ); $ch = curl_init( $url ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_ENCODING, ""); curl_setopt($ch, CURLOPT_USERAGENT, $uagent[$bot]); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_MAXREDIRS, 50); $content = curl_exec( $ch ); curl_close( $ch ); return $content; } Ребята может кто подскажет, что за байда, как разрешить создание файлов более 100кб. я уже всю голову себе сломал блин.
Тестирую только на сервере, на локалке не пробовал вот сам класс Код (Text): <?php if( ! class_exists( 'NEWSRBK_API' ) ) { class NEWSRBK_API { var $result = false; var $cache_dir = false; var $cache_files = array(); function NEWSRBK_API() { if (!$this->cache_dir) { $this->cache_dir = $_SERVER['DOCUMENT_ROOT']."/cache/service/"; } return true; } function save_to_cache ($fname, $vars) { $filename = $fname.".tmp"; $f = @fopen($this->cache_dir.$filename, "w+"); @chmod('0777', $this->cache_dir.$filename); if (is_array($vars)) $vars = serialize($vars); @fwrite($f, $vars); @fclose($f); return $vars; } function load_from_cache ($fname, $timeout=300, $type = 'text') { $filename = $fname.".tmp"; if (!file_exists($this->cache_dir.$filename)) return false; if ((filemtime($this->cache_dir.$filename)) < (time()-$timeout)) return false; if ($type=='text') { return file_get_contents($this->cache_dir.$filename); } else { return unserialize(file_get_contents($this->cache_dir.$filename)); } } function clean_cache($name = "GLOBAL") { $this->get_cached_files(); if ($name=="GLOBAL") { foreach ($this->cache_files as $cached_file) { @unlink($this->cache_dir.$cached_file); } } elseif (in_array($name.".tmp", $this->cache_files)) { @unlink($this->cache_dir.$name.".tmp"); } } function get_cached_files() { $handle = opendir($this->cache_dir); while (($file = readdir($handle)) !== false) { if ($file != '.' && $file != '..' && (!is_dir($this->cache_dir.$file) && $file !='.htaccess')) { $this->cache_files [] = $file; } } closedir($handle); } } } $newsrbk_api = new NEWSRBK_API (); if( ! isset( $result ) ) { include_once ($_SERVER['DOCUMENT_ROOT'].'/includes/config.php'); } $newsrbk_api->result = $result; ?>
можно конечно, но оказывается всё очень просто pcre.backtrack_limit - Лимит обратных ссылок PCRE. Добавлено спустя 37 секунд: вот, что получилось http://newsrbk.ru/allsports/1/