Empty file excel

Hi when I try to export the data It download a excel empty file!!

This is the url of the sample:


I change debug mode to “true” this is the logs files:


What I need to change to work fine?? I’m using PHP 5.3.6 in a Centos server working fine… thanks in advance!!
error.zip (1.26 KB)

A checked your URL - it generated correct Excel.
Could you specify which browser are you using?

I’m using Firefox, Chrome, Ie8, mac, win…

Really this URL

tpv.byebyepelos.net/informes/gri … _text.html

Export a non empty excel file??? because I try it in a lot of computers and it didn’t work!!! it allways export a grid.xls file without data.

Please try it again, because I upload the sample in others servers and works fine, but in this one allways export empty xls file.

Thanks in advance.

You’re right, it generates empty file in Firefox.
Try to comment the follow line in file generate.php:

//$error_handler = set_error_handler("PDFErrorHandler");

After that try to export grid one more time please, it should provide error or warning. It would be useful to know this one.

Ok I have commented the line in file generate.php but now when I click on Get as Excel the site give me a error:

Firefox can’t find the file at tpv.byebyepelos.net/informes/gri … nerate.php.

When I see the error “can’t find the file” I upload again the source example, but it still fails.

Here u can try it again, and I attach the debug file.
tpv.byebyepelos.net/informes/gri … _text.html

Thanks again!!!
debug_2011_07_09__19_21_46.xml.zip (1.07 KB)

It looks like you are using incorrect configured .htaccess file.
It denies access to script which generates excel file.
Make sure access to generate.php file is available.

I have access to generate.php

tpv.byebyepelos.net/informes/gri … nerate.php

And I’m not using .htaccess
Here you have my php configuration


What can I do?

Maybe I’m using some wrong version or I have disable some important library…I’m not sure thanks in adavance.

There is one problem in your case - you have internal server error 500 when you’re trying to call generate.php file.
Do you have access to server logs?
Try to call generate.php one more time, after that have a look at error logs, please.
Do you have some error after that?

If I call directly generate.php

tpv.byebyepelos.net/informes/gri … nerate.php

It’s create a empty debug and error file, here I attach the 2 empty files.

Sorry for the answer delay, thanks in advance.
errorFiles.zip (364 Bytes)

Please insert error_reporting call in generate.php file like here and try to export one more time:


Does any error occur?

I have inserted in generate.php this lines

ini_set(“display_errors”, 1);

If I call directly generate.php

The 2 files debug_ and error_report are empty.

I call the example file
tpv.byebyepelos.net/informes/gri … _text.html

and here I attach the debug and error_report files

ErrorDebug.zip (2.06 KB)

Modify generate.php like here:

function PDFErrorHandler ($errno, $errstr, $errfile, $errline) {
	global $xmlString;
	if ($errno < 1024) {
		echo $errno." ".$errstr." ".$errfile." ".$errline;
		error_log($xmlString, 3, 'error_report_'.date("Y_m_d__H_i_s").'.xml');

Maybe this will help to see the error which breaks your export.

By the way, don’t forget to uncomment the follow line:

$error_handler = set_error_handler("PDFErrorHandler");

Maybe here we have the trouble!!

2 tempnam() [function.tempnam]: SAFE MODE Restriction in effect. The script whose uid is 10010 is not allowed to access /tmp owned by uid 0 /var/www/vhosts/byebyepelos.net/TPV/informes/grid2excel/server/lib/PHPExcel/Writer/Excel5/Worksheet.php 355

But, I find this error inside de grid.xls!!! I saw that wasn’t a empty file and I open it with a notepad editor.

Here you have the error_report and debug file error.zip (2.06 KB)

We became closer to decision of your problem.

  1. Do you have access to php.ini file?
    Try to turn off safe_mode option in php.ini file:
safe_mode = Off
  1. Make sure that directory with export script has write-permissions.

Tell me please if it still doesn’t work.


Now works fine!!! Thanks, I turn off php_safe mode and now began to export files with data, thanks again!!