Forum


Replies: 7   Views: 3733
Output files are not being saved anywhere
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 tarzip  · 15-08-2013 - 02:23

Hi



I am running phpdocx corporate on windows as well as on linux.



php config is exact same. openoffice/libreoffice server is running on both systems



php and java is in system path.



check.php also returns all green on both systems.



I used example from http://www.phpdocx.com/documentation/tutorial#plugin



 



require_once 'path_to_phpdocx/classes/CreateDocx.inc';



$docx = new CreateDocx();



$docx->enableCompatibilityMode();



$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .

    'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .

    'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .

    'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .

    'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .

    'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .

    'officia deserunt mollit anim id est laborum.';



$paramsText = array(

    'b' => 'on',

    'font' => 'Arial'

);



$docx->addText($text, $paramsText);



$docx->createDocx('example_text');

$docx->transformDocx('example_text.docx', 'example_text.html');



but it is not saving files.



I am passing the contents of output files to a variable which is used to display in ckeditor. As files are not being saved so php fails at file_get_contents() as it can't find the output html file.



 



I have used 'method'=>'direct' as well as 'method' => 'script'



I can see with xdebug that it is going through



passthru('php ' . dirname(__FILE__) . '/../lib/convert.php -s ' . $docSource . ' -t ' . $tempDoc . ' -d ' . $docDestination . ' -o ' . $options['odfconverter']);  



when method is script



and going through



passthru('java -jar ' . dirname(__FILE__) . '/../lib/openoffice/jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar ' . $tempDoc . ' ' . $docDestination);



when method is direct



 



What am I doing wrong?



 


Posted by tarzip  · 15-08-2013 - 04:03

just to clarify that above example works from command line



 




i have saved

<?php
require_once 'phpdocx/classes/CreateDocx.inc';

$docx = new CreateDocx();

$docx->enableCompatibilityMode();

$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .
'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .
'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .
'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .
'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .
'officia deserunt mollit anim id est laborum.';

$paramsText = array(
'b' => 'on',
'font' => 'Arial'
);

$docx->addText($text, $paramsText);

$docx->createDocx('example_text');

//$html = file_get_contents('Letterhead.html');

//$docx->embedHTML($html);
//$docx->createDocx("phpdocx_embedHTML.docx");
$docx->transformDocx('example_text.docx', 'example_text.html');
$docx->transformDocx('example_text.docx', 'example_text.pdf');


in php_docx.php



and run as



php php_docx.php and it converts files as it should but it is not working via web app.



my guess is it is failing soem point at passthru command. what are my option to debug and send you the logs?



 



Thanks



 


Posted by jorgelj  · 16-08-2013 - 08:09

Hello,



What web server are you using?, and how are you running PHP?



It may be a problem related to access permissions, for example if you're running SELinux and it doesn't allow Apache to run external commands. Did you check your server logs?



Regards.


Posted by tarzip  · 14-11-2013 - 00:20

sorry for replying so late. I got busy with other projects.



We are running apache and opensuse.



what are the optimal permission setup?



my permissions: phpdocx is 777 for test purposes and it is owned by wwwrun:www which is configured in apache config.



 



what setup you suggest?



thank you very much. 


Posted by jorgelj  · 14-11-2013 - 10:19

Hello,



The latest versions of PHPDocX PRO+, Corporate and Enterprise include four ways to do the transformation.



I recommend you to test the script option avoiding the OdfConverter using apache. And plase paste the result.



Regards.


Posted by tarzip  · 14-11-2013 - 21:46

Thanks for the reply.



script option without odfconverter is working.



What are the advantages or disadvantages of not using odfconverter?



 



Thanks


Posted by jorgelj  · 15-11-2013 - 07:46

Hello,



OdfConverter gets the best quality when you the document has tables and other content like footnotes.



I recommend you to try to run OdfConverter standalone to check if it returns any error. In lib OdfConverter folder there are two versions: one for 32bits OS and other for 64bits.



Regards.