Spreadsheet_Excel_Writer-0.9.2 working on localhost NOT online

I suppose this is a server issue (if I’m wrong please move my thread) cause my script is working fine on my local Apache server :

Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.6

but not working on my online server…

The script uses the Spreadsheet_Excel_Writer-0.9.2 PEAR php library for creating XLS file from PHP/MySql output. As I said, it’s working just fine on my local machine but on my online server I got this warning :

PHP Warning:  require_once(Spreadsheet/Excel/Writer/Workbook.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /path_of_my_docs/PEAR/Spreadsheet_Excel_Writer-0.9.2/Spreadsheet/Excel/Writer.php on line 35
PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Spreadsheet/Excel/Writer/Workbook.php' (include_path='.:/usr/lib64/php:/usr/lib/php:/usr/share/pear') in /path_of_my_docs/PEAR/Spreadsheet_Excel_Writer-0.9.2/Spreadsheet/Excel/Writer.php on line 35

Can you please give some ideas where should I start to resolve this? Thank you in advance!!!

It appears that your server’s PEAR installation does not include your spreadsheet tool. If you have access to the server, you can add it fairly simply with some sort of PEAR command (which I’ve never used to I don’t have the format).

I have been using something similar for many years, though, as there is a class at PHPclasses.org - just do a search for excelwriter.inc.php. It only creates .xls files (not .xlsx) but that makes it useful for older versions of Excel, too.



Thank you David! The excelwriter.inc.php solved my problem. Thank you and thank Harish Chauhan for the script. Regards!

It’s worked a wonder for me … er, my clients for years! Absolutely wonderful and so easy to use.

With that, I have to say that phpclasses.org is a treasure trove of excellent PHP classes.