私は私のウェブサイトのレポートを生成するためにPHPExcelライブラリを使用しています。 DOMPdfでレポートをPDFにエクスポートするのに使っています。小さなレポートではうまく動作しますが、エクスポートするデータがたくさんある場合は、 "net :: ERR_CONNECTION_RESET"と表示されます。 これがなぜ起こっているのかご存じですか? ご協力いただければ幸いです。PHPExcel - DOMPdf接続リセット
これは私がPDFを生成するために使用しているコードです:
public function export_pdf($objPHPExcel,$nameFile){
$rendererName = PHPExcel_Settings::PDF_RENDERER_DOMPDF;
$rendererLibrary = 'dompdf';
$rendererLibraryPath = dirname(dirname(__FILE__)) . '/Vendor/' . $rendererLibrary;
PHPExcel_Settings::setPdfRenderer($rendererName,$rendererLibraryPath);
$chartRendererName = PHPExcel_Settings::CHART_RENDERER_LIBCHART;
$chartRendererLibrary = dirname(dirname(__FILE__)) . '/Vendor/libchart/classes';
PHPExcel_Settings::setChartRenderer($chartRendererName, $chartRendererLibrary);
$worksheet = $objPHPExcel->getActiveSheetIndex();
$objPHPExcel->getActiveSheet()->setShowGridlines(false);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,'PDF');
$objWriter->setIncludeCharts(TRUE);
$objWriter->setSheetIndex($worksheet);
$date = new DateTime();
$objWriter->save('outputfiles/'.$nameFile.$date->getTimestamp().'.pdf');
$url = Router::url('/outputfiles/', true).$nameFile.$date->getTimestamp().'.pdf';
return $url;
}
は、これは私がphp_error.logになってるものです:
[16-May-2016 15:42:30 America/New_York] PHP 6. ReportsController->getTodosforReport() C:\xampp\htdocs\reinier\lib\Cake\Controller\Controller.php:490
[16-May-2016 15:42:30 America/New_York] PHP 7. ReportsController->reservesWithTraces() C:\xampp\htdocs\reinier\app\Controller\ReportsController.php:966
[16-May-2016 15:42:30 America/New_York] PHP 8. ReportsController->export_pdf() C:\xampp\htdocs\reinier\app\Controller\ReportsController.php:1099
[16-May-2016 15:42:30 America/New_York] PHP 9. PHPExcel_Writer_PDF->save() C:\xampp\htdocs\reinier\app\Controller\ReportsController.php:947
[16-May-2016 15:42:30 America/New_York] PHP 10. PHPExcel_Writer_PDF_DomPDF->save() C:\xampp\htdocs\reinier\app\Vendor\PHPExcel\Writer\PDF.php:87
[16-May-2016 15:42:30 America/New_York] PHP 11. spl_autoload_call() C:\xampp\htdocs\reinier\app\Vendor\PHPExcel\Writer\PDF.php:94
[16-May-2016 15:42:30 America/New_York] PHP 12. DOMPDF_autoload() C:\xampp\htdocs\reinier\app\Vendor\PHPExcel\Writer\PDF.php:0
UPDATE: 私が追加この2行は以下の関数に変更されます。
ini_set("memory_limit", '1024M');
ini_set('max_execution_time', 0);
他の提案はありますか?
UPDATE:
これは、私は、Apacheのerror.logファイルに何を得る
ある[Tue May 17 17:23:33.737245 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00428: Parent: child process 15620 exited with status 3221225725 -- Restarting.
[Tue May 17 17:23:34.453984 2016] [ssl:warn] [pid 14132:tid 580] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Tue May 17 17:23:34.545773 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00455: Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 configured -- resuming normal operations
[Tue May 17 17:23:34.545773 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01
[Tue May 17 17:23:34.545773 2016] [core:notice] [pid 14132:tid 580] AH00094: Command line: 'c:\\xampp_183\\apache\\bin\\httpd.exe -d C:/xampp_183/apache'
[Tue May 17 17:23:34.548702 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00418: Parent: Created child process 9356
[Tue May 17 17:23:35.122875 2016] [ssl:warn] [pid 9356:tid 536] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Tue May 17 17:23:35.373832 2016] [ssl:warn] [pid 9356:tid 536] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Tue May 17 17:23:35.417773 2016] [mpm_winnt:notice] [pid 9356:tid 536] AH00354: Child: Starting 150 worker threads.
[Tue May 17 17:25:11.545808 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00428: Parent: child process 9356 exited with status 3221225725 -- Restarting.
[Tue May 17 17:25:12.264499 2016] [ssl:warn] [pid 14132:tid 580] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Tue May 17 17:25:12.307465 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00455: Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 configured -- resuming normal operations
[Tue May 17 17:25:12.308442 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01
[Tue May 17 17:25:12.308442 2016] [core:notice] [pid 14132:tid 580] AH00094: Command line: 'c:\\xampp_183\\apache\\bin\\httpd.exe -d C:/xampp_183/apache'
[Tue May 17 17:25:12.310395 2016] [mpm_winnt:notice] [pid 14132:tid 580] AH00418: Parent: Created child process 11884
[Tue May 17 17:25:12.858201 2016] [ssl:warn] [pid 11884:tid 564] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Tue May 17 17:25:13.098416 2016] [ssl:warn] [pid 11884:tid 564] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Tue May 17 17:25:13.143335 2016] [mpm_winnt:notice] [pid 11884:tid 564] AH00354: Child: Starting 150 worker threads.
うわー!誰かがチャート用のLibChartレンダラーを追加しましたか?残念ながら、PHPExcelライブラリには寄付していません。 –
@マーク・ベイカー、私は棒グラフのためだけにそれを行いました。それが私がPHPExcelライブラリに貢献することを考慮しなかった理由です。このエラーがなぜ起こっているのかご存じですか? – lfal
最も可能性の高い原因はタイムアウトまたはメモリです。ログに何か書き込まれていますか? –