PHPExcel works on Wamp in Windows but not in Linux

Topics: Developer Forum, User Forum
Jun 26, 2011 at 6:55 PM


First sorry for my english

Well, the problem is the next:

I downloaded and I used the last PHPExcel version

I have a script php working fine in my instalation of WAMP in Windows (PHP 5.2.x). The script read  from DB ang generate Excel in correct way. First to test PHPExcel in WAMP installation I used "01simple-download-xls.php" in test folder (Of course I correct the path of require ...). Ok, all fine in Windows in WAMP (the only thing was enabled gd2)

When i tried to probe in my linux installation (Opensuse 11.1, PHP 5.2.14, Apache2) the result was (and is) in Firefox:

File not found
Firefox can't find the file at http://localhost/Certificados/Clases/PHPExcel/Tests/01simple-download-xls.php.
    *   Check the file name for capitalization or other typing errors.
    *   Check to see if the file was moved, renamed or deleted.

The class referenced in the script is correct (require_once '../PHPExcel.php';) all is the same that in the WAMP installation.

If I comment the line :   $objWriter->save('php://output');  then the 01simple.xls is generated and the browser offered to open,  but IS EMPTY. (well is ok, there is not output)

But If comment the line of headers (and is not comment the line of objWriter): /*header('Content-Type: application/');
header('Content-Disposition: attachment;filename="01simple.xls"');
header('Cache-Control: max-age=0');*/

                              Nothing happens (no erros but no output yet)

The extensions gd, xml and zip are installed in PHP (probed with: echo "GD: ", extension_loaded('gd') ? 'OK' : 'MISSING', '<br>';
echo "XML: ", extension_loaded('xml') ? 'OK' : 'MISSING', '<br>';
echo "zip: ", extension_loaded('zip') ? 'OK' : 'MISSING', '<br>';)

The "" is in the apache.conf (in the /etc/apache2/mime.types file)



For me is something in Apache2, but what?