Phpexcel upload SAE encountered: -1:fail to get XML content

Source: Internet
Author: User

When using PHPExcel1.8.0 to work with Excel , local testing works, but to deploy the code to the SAE, youwill encounter this problem when uploading the code.

Problem encountered in deployment code : -1:fail to get XML content

In the online search, a lot of people in the use of WordPress and weiphp also encountered this problem, the solution is, with WordPress for SAE,weiphp Also modify that what code, to phpexcel no reference value. For the time being I don't know how this problem affects my application, so I'll skip it for a moment.

At the end of the deployment, when you visit the page, you will get an error when you need Excel processing.

The error is that XMLWriter is not found in this class. I found it in the source code of Phpexcel, and I did not find the definition of this class, only the extension of this class.

This should be the effect of the previous mistake.

Some people on the internet say that this problem is not supported by PHP version, I believe it.

To the application management of the SAE looked under, is PHP5.3, version does not support should be the version is too old, so I deleted the old application, a new PHP5.6 application. But uploading the code is still the problem of fail to get XML content . I will be hehe.

Some people say that there is a problem uploading the code package, there is, after the deployment of the correct code in the local git or svn submission. I was doubtful, and tried, and it was no use.

Some people say, to change the Excel2007 to Excel5, I believe. I went to change the code and changed the format of the Excel document from xlsx to XLS. The result still did not find XMLWriter this mistake.

Baidu does not, I use Google, the results have encountered the same problem, but there is no solution to the answer. when I helpless, I finally found a way to refer to.

The error is: Class ' XMLWriter ' not found

file:thinkphp/extend/vendor/excel/phpexcel/shared/xmlwriter.php line:44

Check the next, local everything is OK. Native PHP extensions have xmlwriter,saw extensions with XML. Ask how to break? JORBIN2014 Year June 30

As long as the Phpexcel version supports XML extensions, I'm using 1.7.2.

From <http://www.thinkphp.cn/topic/12201.html>

phpexcelxml extension. I believed it, so I went to phpexcel There was a 1.7.21.8.01.7.2excel5git Submit, submit the new code up. As a result, there is no report to find xmlwriter

But also reported a problem that could not find the class to write Excel5 . Similarly, I now in the source code according to the law to find this class, there is really, directly include the reference on the line. One more try and that's not the problem. Happy. (There should be a new error, that is, read and write errors to the file, if the same as I did not realize that the SAE use storage to process the file, this issue in another article)

In conclusion, the problem that I have encountered in uploading an application that uses Phpexcel is probably the phpexcel version. So we have to circumvent this problem by using a version that supports extended XML . That is 1.7.2 (good test ).

Phpexcel upload SAE encountered: -1:fail to get XML content

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.