그래서이 CI 프로젝트를 데이터베이스에서 CSV로 변환했습니다.프로세스가 오래 걸려서 "이 페이지가 작동하지 않습니다. <ssh-server-ip-address>는 데이터를 보내지 않았습니다 .ERR_EMPTY_RESPONSE"
SSH 서버에 배포되었습니다.
모든 데이터를로드하려고합니다 (2,000,000 이상이 넘습니다). 그런 다음 CSV로 변환하려고합니다. 난 단지 이메일을 가진 행으로 필터링
내 첫 번째 시도는
그것은 성공적으로 (약간의 시간이 걸렸다) CSV로 데이터를 내보낼 (그래서 나 66,000+ 데이터입니다. 제공). 나는 마침내 내가 "CSV로 변환"를 클릭 한 후 모든 데이터를 내보낼 때
그러나, 그것은 너무 많은 시간 로딩을하고 브라우저 오류 제공 :
This page isn’t working
<server-ip-address> didn’t send any data.
ERR_EMPTY_RESPONSE
이 상관 할 일이 있습니까를 서버와 함께?
나는 이러한 설정으로/etc/php.ini
에서 설정을 변경 시도 :
max_execution_time = 259200
max_input_time = 259200
memory_limit = 300M
session.gc_maxlifetime = 1440
을하지만 여전히 날 같은 오류를 제공합니다.
어떻게 해결할 수 있습니까? 제발 도와주세요.
UPDATE : 나는 여기있다, csv로 다운로드 내 코드를 포함 :
이public function convcsv(){
ini_set('memory_limit', '-1');
set_time_limit(0);
$prefKey = $this->session->flashdata('prefKey');
$searchKey = $this->session->flashdata('searchKey');
$withEmail = $this->session->flashdata('withEmail');
log_message('debug', 'CONVCSV prefKey = ' . $prefKey);
log_message('debug', 'CONVCSV searchKey = ' . $searchKey);
$list = $this->user_model->get_users($prefKey, $searchKey, $withEmail, "", "");
log_message('debug', 'Fetched data');
$headerArray = array("id", "prefecture_id", "industry_id", "offset", "name", "email");
// Header
$header = str_replace(",", "", $headerArray);
$datas = implode(',', $header) . "\r\n";
// Body
foreach($list as $body)
{
// 配列の内容を「,」区切りで連結する
$orig_email = $body['email'];
$mstring = preg_replace("/^([^a-zA-Z0-9])*/",',',$orig_email);
preg_match_all("/[\._a-zA-Z0-9-][email protected][\._a-zA-Z0-9-]+/i", $mstring, $matches);
$email = implode($matches[0]);
//$email = $matches[0];
$datas .= $body["id"].",".$body["prefecture_id"].",".$body["industry_id"].",".$body["offset"].",".preg_replace('/[,]/',' ',$body["name"]).",".$email."\r\n";
}
// 文字コード返還
$datas = mb_convert_encoding($datas, "SJIS-win", "UTF-8");
// ダウンロード開始
$csvFileName = "phpList_" . date('Ymd_His') . ".csv";
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $csvFileName);
header('Content-Transfer-Encoding: binary');
while (ob_get_level() > 0)
{
ob_end_clean();
}
ob_start();
print trim($datas);
ob_flush();
ob_end_clean();
exit;
}
브라우저를 통해 다운로드해야합니까? ftp가 더 효율적입니다. – nogad
@nogad 옵션이 없습니다. 그것은 데이터를 CSV로 변환하는 codeigniter 프로젝트에서 가져온 것입니다. –
파일을 제공 하시겠습니까? 또는 데이터 스트림? 파일을 압축하는 것을 고려 했습니까? – nogad