PHP利用phpExcelReader讀取Excel錯誤總結____PHP

來源:互聯網
上載者:User


PHP利用phpExcelReader讀取Excel錯誤總結如下:

錯誤一:Deprecated: Assigning the return value of new by reference is deprecated in  Assigning the return value of new by reference is deprecated in E:\WebSite\htdocs\EXCEL2\Excel\reader.php on line 261
這個是php5.3以後版本的問題,php5.3以下版本不會出現
$this->_ole =& new OLERead();
改為:
$this->_ole = new OLERead();
php5.3開始後,廢除了php中的”=&”符號,所以要想複製,直接用=引用即可

錯誤二:Warning: require_once(Spreadsheet/Excel/Reader/OLERead.php) [function.require-once]: failed to open stream: No such file or directory in E:\WebSite\htdocs\EXCEL2\Excel\reader.php on line 31
修改辦法:
將require_once 'Spreadsheet/Excel/Reader/OLERead.php';
改為:require_once 'oleread.inc';

錯誤三:
Notice: iconv() [function.iconv]: Detected an illegal character in input string in D:\wamp\www\phpExcelReader\Excel\reader.php on line 1056
修改辦法:
將example.php裡面的
$data->setOutputEncoding('CP1251');
改為:
$data->setOutputEncoding('UTF-8');  //或者你的程式編碼是gbk的就改為GB2312

錯誤四:
Fatal error: Maximum execution time of 30 seconds exceeded in E:\WebSite\htdocs\EXCEL2\Excel\oleread.inc on line 172
下載的裡面的jxlrwtest.xls這個excel檔案有錯誤,請自己建立一個

下載地址:http://sourceforge.net/projects/phpexcelreader/



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.