Forum


Replies: 4   Views: 6280
Yet another installation issue - free version throwing license error and more!
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by mightycpa  · 12-04-2013 - 22:19

I did as the instructions asked for the free version:




  • Extracted the files.

  • Ran check.php, everything is ok. 

  • Placed everything in the new folder "phpword". 

  • Created a new docs folder

  • Gave it 755 permissions. Tried 777 too.

  • Looked in the examples folder, but it is empty

  • Copied the four lines from the simplest example, changed the include path and saved it in a file:

  • <?php

    require_once('./phpword/classes/CreateDocx.inc');

    $docx = new CreateDocx();

    $docx->addText('Hello world!');

    $docx->createDocx('../roster_doc/hello_world');

    ?>

  • Ran my little test



BOOM!



[12-Apr-2013 14:13:13] PHP Warning:  file_get_contents(/home2/xxxxxxxx/public_html/tysonscup/phpword/classes/code) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home2/managemy/public_html/tysonscup/phpword/classes/GenerateDocx.inc on line 46

[12-Apr-2013 14:13:13] PHP Fatal error:  Uncaught exception 'Exception' with message 'There is not a valid license' in /home2/xxxxxxxxy/public_html/tysonscup/phpword/classes/PhpdocxLogger.inc:56

Stack trace:

#0 /home2/xxxxxxxxx/public_html/tysonscup/phpword/classes/CreateDocx.inc(1088): PhpdocxLogger::logger('There is not a ...', 'fatal')

#1 /home2/xxxxxxxxxxy/public_html/tysonscup/test_file.php(3): CreateDocx->__construct()

#2 {main}

  thrown in /home2/xxxxxxxxxx/public_html/tysonscup/phpword/classes/PhpdocxLogger.inc on line 56



Help!



 


Posted by mightycpa  · 13-04-2013 - 03:35

I opened GenerateDocx.inc, and found line 46.  It was part of an if block shown below.  I added the error log error in an effort to see what the code was looking for:



        if (!isset($_SERVER['SERVER_NAME'])) {

            return;

        } else {

error_log(dirname(__FILE__) . '/code' );

            $xzerod = trim(file_get_contents(dirname(__FILE__) . '/code'));

            $xzerob = trim(gethostbyname($_SERVER['SERVER_NAME']));

            $xzeroc = trim($_SERVER['SERVER_NAME']);

        }



 



It wants this:



 /home2/managemy/public_html/tysonscup/phpword/classes/code



 



There are two problems:



1) There is no folder "code" in the classes folder



2) There is no file where the function can get contents



AND



Even if I add the folder "code", or I change the code to use "conf", then the license error comes up.  Supposedly, I don't need a license code for the free version; at least, there is no instruction for that.



This free version doesn't seem to work any more.  The last free version that seemed to work in the forums is about a year ago.


Posted by jorgelj  · 13-04-2013 - 10:15

Hello,



Thanks for your post, it was a problem related to the migration of the website. Now itis fixed and you can download the free version.



Regards.


Posted by mightycpa  · 19-04-2013 - 15:20

Thanks, I did that, it works like a charm now.  The only additional suggestion I would make is to include the location of the CreateDocX.inc file (classes folder) in your installation instructions.



Thanks again.