I use PHPExcel to process excel documents. There was such a task: the excel file is laid out on the windows server at \\server\change\ex.xls . Next, read the file and operate on the data. PHPExel can't read

 Could not open \vrt-sql\Change\ex.xls for reading! File does not exist. (0) 

$Excel = PHPExcel_IOFactory::load('\\vrt-sql\Change\ex.xls'); query $Excel = PHPExcel_IOFactory::load('\\vrt-sql\Change\ex.xls');

As I understand it, the problem is with the NFS address. Tell me how can I read this file using PHP? Or suggest another way to do this. PS CentOS 7, PHP 7.0.27

I forgot to mention that the process will be automated. It is assumed 3-4 files per day and possibly at night.

  • And copy the file to yourself and use a local copy - will not work? - Akina
  • @Akina Forgot to mention that the process will be automated. It is assumed 3-4 files per day and possibly at night. - ZIBER MINSK
  • And what's the difference? in any case, you start the import process with the copying procedure to a temporary directory (even if it is a local file, and even more so if the file is on another computer, FTP server, is accessible via HTTP or in some thread of the file exchange or workflow system), and you finish by deleting this copy. At the same time, you will receive a guarantee that during processing no one will adjoin the file with unwashed hands. - Akina
  • @Akina I agree, just how to pick it up from another server? For example, hang the event on crones, which will take this file to a temporary folder, and then start processing. - ZIBER MINSK
  • how to pick it up from another server? php.net/manual/ru/function.copy.php - Akina

1 answer 1

I solved the question through Samba, sharing the folder in which the excel document will be thrown off, and then processed by PHPExcel