The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Perl Package installed Spreadsheet_Excel_Writer

Discussion in 'General Discussion' started by ral.catindoy, Nov 21, 2012.

  1. ral.catindoy

    ral.catindoy Registered

    Joined:
    Nov 21, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I installed 2 packages so I can use it, the OLE and the Spreadsheet_Excel_Writer modules. I have installed them successfully but I, forgive me, have no idea how to use it. I mean, I have looked for how to use the module, and my problem is that the line where I put require on my webpage is the error. I don't know how to access it outside the public html. Does this make sense to any of you? I'm really sorry, I just started using cPanel few weeks ago and still trying to learn. Please help!
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,466
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    It might be helpful if you explained what it is you're hoping to accomplish.

    There are docs here that you might find useful:
    /http://pear.php.net/manual/en/package.fileformats.opendocument.text.intro.php
    /http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.php
     
  3. ral.catindoy

    ral.catindoy Registered

    Joined:
    Nov 21, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thank you for replying!
    Well this is the line of error from my page:

    Warning: require_once(Spreadsheet/Excel/Writer.php) [function.require-once]: failed to open stream: No such file or directory in /home/renndesi/public_html/alexis/tests/phpExcelWrite/writeExcel.php on line 2

    and this is what's on my page:

    <?php
    require_once 'Spreadsheet/Excel/Writer.php';

    // Creating a workbook
    $workbook = new Spreadsheet_Excel_Writer();

    // sending HTTP headers
    $workbook->send('test.xls');

    // Creating a worksheet
    $worksheet =& $workbook->addWorksheet('My first worksheet');

    // The actual data
    $worksheet->write(0, 0, 'Name');
    $worksheet->write(0, 1, 'Age');
    $worksheet->write(1, 0, 'John Smith');
    $worksheet->write(1, 1, 30);
    $worksheet->write(2, 0, 'Johann Schmidt');
    $worksheet->write(2, 1, 31);
    $worksheet->write(3, 0, 'Juan Herrera');
    $worksheet->write(3, 1, 32);

    // Let's send the file
    $workbook->close();
    ?>

    I was thinking that maybe it doesn't work because I have the wrong path, but I can't figure it out. the extension is outside the public_html and I don't know how to access that using the require_once.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,466
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Well, I'll be of no real help here on this I don't think. I do know that when I check:
    Home » Software » Install a Perl Module
    OLE and the Spreadsheet_Excel_Writer appear to be already installed on multiple servers here.

    If I search the system for the exact word: Spreadsheet
    It shows as being located here:
    /usr/lib/perl5/site_perl/5.8.8/Spreadsheet/
    And here:
    /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Spreadsheet/

    Neither of those directories has an Excel/ directory in it, nor a php file called, Writer.php, so yes, your path is incorrect I think.

    You might check out a few of these links for tips:
    require_once 'Spreadsheet/Excel/Writer.php'; - google search
     
  5. ral.catindoy

    ral.catindoy Registered

    Joined:
    Nov 21, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    It's okay, thank you though. I hope someone knows something about this so I can be enlightened.
     
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    If the PEAR module is not in PHP's include path then you'll need to give the full path to require or include. For example if the module is in /home/renndesi/Spreadsheet/Excel then your require statement should look like:

    Code:
    require_once '/home/renndesi/Spreadsheet/Excel/Writer.php';
    
     
Loading...

Share This Page