#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2008
    Posts
    100
    Rep Power
    14

    Problem Using PHPExcel - Gets Stuck


    System:
    Windows Server 2003
    Windows IIS 6
    PHP Build v5.2.8

    http://www.codeplex.com/PHPExcel I'm trying to use PHPExcel which can be found at that link. It allows fairly easy read/write support for PHP in to an Excel 2007 file.

    I see they require php_zip, php_xml, and php_gd2 to be enabled, which is probably my problem. php_zip.dll and php_gd2.dll come with PHP in the ext folder so they were easily enabled; however, there is no php_xml and just about zero results when I google it for a download.

    Anyway, here is the code where the page is getting stuck at and the results I get when I run the page. Any help would be greatly appreciated.

    Code for PHP file. 01simple.php -- EXCERPT
    Code:
    // Save Excel 2007 file
    echo date('H:i:s') . " Write to Excel2007 format<br>";
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
    $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
    
    // Echo memory peak usage
    echo date('H:i:s') . " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB\r<br>";
    
    // Echo done
    echo date('H:i:s') . " Done writing file.\r<br>";
    And this is the results I get when I run the page:
    Code:
    09:41:19 Create new PHPExcel object
    09:41:19 Set properties
    09:41:19 Add some data
    09:41:19 Rename sheet
    09:41:19 Write to Excel2007 format
    Thank you!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2008
    Posts
    100
    Rep Power
    14
    Took me 2 hours to figure out and as soon as I posted my question, I found the answer. The problem was my ext dir loaded in to php.ini was wrong; therefore, the exts were not loading. Changed it to the correct directory and everything works fine now.

    Hope this helps anyone who may encounter this problem!

    BTW, if you haven't checked out this add-on it's worth a look!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Nov 2001
    Location
    North West UK
    Posts
    1,147
    Rep Power
    395
    Originally Posted by fleppar
    Took me 2 hours to figure out and as soon as I posted my question, I found the answer. The problem was my ext dir loaded in to php.ini was wrong; therefore, the exts were not loading. Changed it to the correct directory and everything works fine now.

    Hope this helps anyone who may encounter this problem!
    Glad you got it fixed, and thanks for posting a solution to anybody else that might be having the same problem

    Originally Posted by fleppar
    BTW, if you haven't checked out this add-on it's worth a look!
    Seconded.... and due for some pretty major improvements/enhancements in the next few months
    Last edited by Mark Baker; April 2nd, 2009 at 09:37 AM.
    9 out of 10 PHP problems can be resolved by setting
    PHP Code:
    error_reporting(E_ALL);
    ini_set('display_errors'1); 
    php -l <filename> will identify 9 out of the remaining 10 problems
    Remember, the command line is your friend

    Development Projects:
    PHPExcel
    PHPPowerPoint
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    1
    Rep Power
    0
    Can I make interactive Excel sheet on browser using PHPExcel? PHPExcel_reader allows us to read the excel datas on browser and PHPExcel_writer allows us to write the excel datas on browser. I want to update the datas on the excel sheet in browser itself. Is it possible?

    Please help me.

IMN logo majestic logo threadwatch logo seochat tools logo