Guide to PHP SecurityQuicksearchCalendar
|
Friday, August 27. 2010PHP Excel Extension 0.8.6
PHP Excel Extension 0.8.6
The 0.8.6 version of the Excel extension was released and is now available for download. This version was updated to contain LibXL 3.0 support which introduces Excel 2007/2010 read/write support, which means that this extension can now read and generate any Excel file. Support for XSLX (2007/2010) format can be enabled by passing "true" as the 3rd parameter to the ExcelBook() construtor. GitHub: http://github.com/iliaal/php_excel/ Source: http://github.com/downloads/iliaal/php_excel/php-excel-0.8.6.tar.bz2 Comments
Display comments as
(Linear | Threaded)
I am getting the following error on tests 054.phpt - 056.phpt.
*** glibc detected *** php: free(): invalid pointer: 0x0a66eef8 ****** glibc detected *** php: free(): invalid pointer: 0x0a66eef8 *** It seems to be related to providing a third option to the ExcelBook class.
I am not seeing that error, even when using valgrind on that test. Could you try generating a backtrace?
Here you go
*** glibc detected *** php: free(): invalid pointer: 0x08f2b598 *** ======= Backtrace: ========= /lib/libc.so.6[0x62a5a5] /lib/libc.so.6(cfree+0x59)[0x62a9e9] /usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xe9c581] /usr/lib/libstdc++.so.6(_ZNSbIwSt11char_traitsIwESaIwEE4_Rep10_M_destroyERKS1_+0x1d)[0xe9432d] /usr/lib/libstdc++.so.6(_ZNSbIwSt11char_traitsIwESaIwEED1Ev+0x57)[0xe96117] /usr/lib/libxl.so(_ZN3lmx24ct_simple_non_pod_singleISbIwSt11char_traitsIwESaIwEENS_12ct_non_mixedIS4_EEED1Ev+0x40)[0x34242f0] /usr/lib/libxl.so(_ZN13relationships17c_CT_RelationshipD0Ev+0x4f)[0x3782d6f] /usr/lib/libxl.so(_ZN13relationships18c_CT_RelationshipsD2Ev+0x54)[0x3785952] /usr/lib/libxl.so(_ZN13relationships15c_RelationshipsD1Ev+0x28)[0x3785a16] /usr/lib/libxl.so(_ZN5libxl13RelationshipsD0Ev+0x8e)[0x35a801e] /usr/lib/libxl.so(_ZN5libxl12XMLBookImplTIcE5clearEv+0x46)[0x35998be] /usr/lib/libxl.so(_ZN5libxl12XMLBookImplTIcED0Ev+0x36)[0x35a4ce6] /usr/lib/libxl.so(_ZN5libxl12XMLBookImplTIcE7releaseEv+0x15)[0x359965d] /usr/lib/libxl.so(xlBookReleaseA+0x11)[0x32f6859] /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/excel.so[0x3ad261] php(zend_objects_store_del_ref_by_handle_ex+0x1cf)[0x847027f] php(zend_objects_store_del_ref+0x20)[0x84704c0] php(_zval_dtor_func+0x4e)[0x844edfe] php(_zval_ptr_dtor+0x46)[0x8444de6] php[0x845c448] php(zend_hash_reverse_apply+0x6e)[0x845ae5e] php(shutdown_destructors+0x53)[0x84448b3] php(zend_call_destructors+0x55)[0x844f985] php(php_request_shutdown+0x325)[0x83feca5] php(main+0x58e)[0x84c44ce] /lib/libc.so.6(__libc_start_main+0xdc)[0x5d6e9c] php[0x80a6981]
Can try to compile php with --enable-debug and see if the error happens still?
I've tried a few times with different configurations, but so far had no luck reproducing the problem.
I re-compiled (I did change my PHP version and compiled with --enable-debug) and the problem went away. Not sure what the issue was, but it isn't happening anymore.
Thank you so much for looking into the problem.
Hi there,
I have installed libXl-3.0.1 and PHPExcel-0.8.6 . now i want to use it off-course. is there any syntax summary available at the moment. on a Japanese site I've found all the available public functions. But it should be easier to have a summary of what kind of variables are necessary and what the function actually does. Regards, Falco
add:
- i have made a start of a file. it can be found at: http://falcovd.nl/phpsFiles/clsLibXl.phps i use: $b{var} => boolean $i{var} => int $str{$var} => string
You can see the API in actions via the test-suit included in the extension or via reflection of the excel extension.
Hi there,
i want to try this extension, but i can't install it on linux into my apache-php-install. Please show me how to install the libxl and the extension! Thanks for your help.
you have to login into the shell by for example ssh.
1) be sure you are root 2) mkdir ~/Downloads/ 3) cd ~/Downloads/ 4) wget http://www.libxl.com/download/libxl.tar.gz 5) wget http://github.com/downloads/iliaal/php_excel/php-excel-0.8.6.tar.bz2 Now untar your files 6) tar -zxvf libxl.tar.gz 7) tar -jxvf php-excel-0.8.6.tar.bz2 cd libxl-3.0.1/ ln -s include_c include cd ../excel-0.8.6 phpize ./configure make make install the excel.so file is added in your modules directory. edit your php.ini and add: extension=excel.so apache reload, and tada... excel and libxl are ready to use
Hi Falco,
i have done your description, but i have this errors (please help): **output after call "./configure"** checking for egrep... grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking whether gcc and cc understand -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for PHP prefix... /usr/local checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20060613 checking for PHP installed headers prefix... /usr/local/include/php checking for re2c... no checking for gawk... gawk checking for excel support... yes, shared checking for excel files in default path... not found configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers. configure: error: Please reinstall the excel distribution
try instead of "./configure"
./configure --with-excel=../libxl-3.0.1/ --with-libdir=../libxl-3.0.1/lib64/ or if you are using x86 ./configure --with-excel=../libxl-3.0.1/ --with-libdir=../libxl-3.0.1/lib/
now I get this error (I use lib64)
... checking for xlCreateBookCA in -lxl... no configure: error: excel module requires libxl >= 2.4.3
I'm sorry
please remove the ending slashes by the --with rules then it should work
This is the configure command:
Server:/usr/local/include/excel-0.8.6 # ./configure --with-excel=../libxl-3.0.2 --with-libdir=../libxl-3.0.2/lib64 but the same error. Info: PHP Version => 5.2.4 Apache 2 OpenSuse 10.0 php.ini => /usr/local/lib/php.ini
okay,
i removed all my files and followed the upper instructions. i found out how to do in libxl-3.0.2: 1) cd ../libxl-3.0.2/lib/ 2) cp libxl64.so libxl.so 3) cd ../../excel-0.8.6/ 4) ./configure --with-excel=../libxl-3.0.2 --with-libdir=../libxl-3.0.2/lib
Hi, i have delet all files do this again
cd /daten/temp/src/ wget http://www.libxl.com/download/libxl.tar.gz wget http://github.com/downloads/iliaal/php_excel/php-excel-0.8.6.tar.bz2 tar -zxvf libxl.tar.gz tar -jxvf php-excel-0.8.6.tar.bz2 cd libxl-3.0.2/ ln -s include_c include cd lib/ cp libxl64.so libxl.so cd ../../excel-0.8.6/ phpize ./configure --with-excel=../libxl-3.0.2 --with-libdir=../libxl-3.0.2/lib but the same error: ... checking for xlCreateBookCA in -lxl... no configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers. configure: error: excel module requires libxl >= 2.4.3
Hi Falco,
the configure command works on a other Server (32 Bit) (./configure --with-excel=../libxl-3.0.2 --with-libdir=../libxl-3.0.2/lib) 32 Bit System PHP Version => 5.2.9 Apache 2 OpenSuse 10.3 php.ini => /etc/php5/apache2/php.ini
I'm sorry for not replying your last comment.
for me it was working on a 64 bit Ubuntu 10.04 server
Compatible versions for using with this extension:
LibXL for Windows 3.0.1 - http://www.libxl.com/download/libxl-3.0.1.zip LibXL for Linux 3.0.1 - http://www.libxl.com/download/libxl-3.0.1.tar.gz
Hi, We're getting a crash on reading sheet with accent character (й). Once we replace this in the sheet with a plain (e) it works fine. Any ideas on how to handle this?
At the moment we are getting an Apache segfault. Thanks
Can you please e-mail me a reproduce script, I'd be happy to look into the problem.
Thanks Ilia, that would be awesome. I've loaded a test XLS and PHP script to http://www.alainrussell.com/test.zip.
Latest version of LibXL, Latest PHP Extension, PHP 5.2.13 Thanks. Alain
I've tried the test file (had to make a few tweaks to make it run). However I am not seeing a crash, valgrind is also not reporting any memory errors.
Can you generate a backtrace of the crash?
Ok, maybe its something else in the XLS. Full (non-truncated) file is here - this causes a crash http://www.alainrussell.com/sample.zip
(checked the sample we sent and it processed fine for me as well .. duh) Thanks again.
I tried the bigger file, takes a bit longer to run but, I still do not see a crash or any errors via valgrind.
If you could generate a backtrace, it would be helpful to identifying what is crashing.
Hi Ilia,
I've generated one here - let me know if this helps. http://www.alainrussell.com/backtrace.txt
Can you reproduce the crash on the command line? What locale does Apache use?
Looks like command line runs without a crash - locale on the machine is below.
www1:$ locale LANG=en_NZ.UTF-8 LC_CTYPE="en_NZ.UTF-8" LC_NUMERIC="en_NZ.UTF-8" LC_TIME="en_NZ.UTF-8" LC_COLLATE="en_NZ.UTF-8" LC_MONETARY="en_NZ.UTF-8" LC_MESSAGES="en_NZ.UTF-8" LC_PAPER="en_NZ.UTF-8" LC_NAME="en_NZ.UTF-8" LC_ADDRESS="en_NZ.UTF-8" LC_TELEPHONE="en_NZ.UTF-8" LC_MEASUREMENT="en_NZ.UTF-8" LC_IDENTIFICATION="en_NZ.UTF-8" LC_ALL=
Is the locale the same when the script runs via Apache?
|
ArchivesCategoriesSyndicate This BlogBlog Administration |
|||||||||||||||||||||||||||||||||||||||||||||||||










Comments