Reading excel file in PHP with PHPExcel library -


when try read uploaded excel file upload folder phpexcel library, can cause error , can't find reason. according nginx log, there "connection reset peer" error below:

[error] 111#111: *124 recv() failed (104: connection reset peer) while reading response header upstream, client: 172.17.0.1, 

until line $objphpexcel = $objreader->load( $file_name ); seems fine on line, file can not executed , besides this, there isn't exception in catch block.

as result of problem, nginx gives 502 bad gateway error in browser.

public function load_excel( $file_name )     {         try {              /**  identify type of $inputfilename  **/             $inputfiletype = \phpexcel_iofactory::identify( $file_name );             /**  create new reader of type has been identified  **/             $objreader = \phpexcel_iofactory::createreader( $inputfiletype );             /**  advise reader want load cell data  **/             $objreader->setreaddataonly( true );             /**  load $inputfilename phpexcel object  **/             $objphpexcel = $objreader->load( $file_name );         } catch(\phpexcel_reader_exception $e) {             error_log($e->getmessage());             return false;         }         return $objphpexcel;     } 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -