0

我正在尝试在我的数据库中上传 10k+ 数据(使用 PHP 和 Mysql)。但是文件似乎太大了。如果我将文件的大小减少到大约 9300 条记录,它工作得很好,但在此之上,我的代码似乎在下一行失败了,$excelReader = PHPExcel_IOFactory::createReaderForFile($tmpfname); 我只包含了我的代码片段(我认为与这个问题有关)。我也有upload_max_filesize=124Mpost_max_size=124。可能是什么问题呢?

<?php
        $tmpfname = $_FILES['file_save']['tmp_name'];
    echo "0";   
        $excelReader = PHPExcel_IOFactory::createReaderForFile($tmpfname);
echo "1";
        $excelObj = $excelReader->load($tmpfname);
        echo "2";
        $worksheet = $excelObj->getSheet(0);
        echo "3";
        $lastRow = $worksheet->getHighestRow();

    ?>
4

1 回答 1

0

follow this link : http://www.ozerov.de/bigdump/usage/

  1. Download and unzip bigdump.zip on your PC.
  2. Open bigdump.php in a text editor, adjust the database configuration and dump file encoding.
  3. Drop the old tables on the target database if your dump doesn’t contain “DROP TABLE” (use phpMyAdmin).
  4. Create the working directory (e.g. dump) on your web server
  5. Upload bigdump.php and the dump files (*.sql or *.gz) via FTP to the working directory (take care of TEXT mode upload for bigdump.php and dump.sql but BINARY mode for dump.gz if uploading from MS Windows).
  6. Run the bigdump.php from your web browser via URL like http://www.yourdomain.com/dump/bigdump.php.
  7. Now you can select the file to be imported from the listing of your working directory. Click “Start import” to start.
  8. BigDump will start every next import session automatically if JavaScript is enabled in your browser.
  9. Relax and wait for the script to finish. Do NOT close the browser window!
  10. IMPORTANT: Remove bigdump.php and your dump files from your web server.
于 2016-10-04T13:13:31.677 回答