Forum


Replies: 10   Views: 5031
Class 'phpdocx\converters\com' not found
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 IncodisPM  · 30-03-2016 - 12:42

Hi,
I am using Ubuntu 14.04 LTS and i was installing phpdocx to convert docx to pdf, all was going well. I was able generate docx and pdf too but unfortunately got stuck in generating using "transformDocxUsingMSWord" and when i tried to run php file to generate docx or pdf in"transformDocxUsingMSWord" it gives error 

PHP Fatal error: Class 'Phpdocx\Converters\COM' not found in /var/www/phpdocx-corporate-5.5-ns/Classes/Phpdocx/Converters/MSWordInterface.inc on line 52

I thought this is regarding php extension but i found nothing while googling for long time. However, it shows method to enable "com" extension in windows. So, basically i found nothing to overcome this problem

I'm here to look for solution, maybe someone help me with issue.

Posted by admin  · 30-03-2016 - 15:07

Hello,

PHP COM extension is only available for Windows servers. We recommend you to use the conversion plugin that is compatible with Linux, Windows and Mac OS X.

You may find more information about the conversion plugin on:

http://www.phpdocx.com/documentation/conversion-plugin

Regards.

Posted by IncodisPM  · 31-03-2016 - 13:59

Hey,

Thanks for your support, i already added that "method" and "path" i.e of Libreoffice 

but i was losing in "$docx = new TransformDocAdvLibreOffice();" .

After adding this to my file it is converting "docx" to "html", but there is issue in successfully generation of "html". The html file is not generated successfuly. If you wish i can attach that html file!! 

One more thing that i downloaded it as pdf and it's aying like "Unable to open document"

Posted by admin  · 31-03-2016 - 17:21

Hello,

If when you open the PDF it returns an error (such as 'Unable to open document') then it's being generated corrupted. Please follow the steps explained on:

http://www.phpdocx.com/documentation/conversion-plugin/debugging-libreoffice

the debug it. If you prefer that we check it, please send the DOCX you're trying to transform to contact[at]phpdocx.com

Regards.

Posted by IncodisPM  · 01-04-2016 - 14:04

Hello,

Thanks for your support. It's working like charm on my local ubuntu machine.

When we try the same on server CentOS 6.7, it worked through terminal (it created html, pdf successfully) but when we try from browser it goes into loop (didn't generate any result) . Could you suggest something to resolve this

Posted by admin  · 02-04-2016 - 06:59

Hello,

If it's working using PHP CLI mode, the most common issue is related to .config folder. We recommend you to check that this folder exists (create it if doesn't exist in the home folder of the web server user) and set 777 for the whole directory. And also check your web server logs and the 4th item on http://www.phpdocx.com/documentation/conversion-plugin/debugging-libreoffice

Regards.

Posted by IncodisPM  · 04-04-2016 - 07:48

Hello,

Thanks again for your support. All are setup correctly 

Posted by IncodisPM  · 04-04-2016 - 15:24

Hello,

Just faced problem in generated html file (it consists special character), mean html file is not  generated successfully.

Actually we had a server where there are two users where there is a "separate user for apache". So, when i checked home directory there was no config folder in "apache user". Can you please help to generate config folder in "apache user" so that html file can work properly.

Even i tried to generate .config folder with command:

# soffice --headless --env:UserInstallation=file://~/.config

and give permissions to it, but that doesn't work. Am i generating this config folder wrong, can you help me to generate config folder in "apache user". So that, the html file can work properly or is there any other problem wih two users which may usually occur.

Posted by admin  · 05-04-2016 - 06:19

Hello,

You don't need to generate any special directory structure, just create an empty .config folder in the home of the user webserver and set it as 777. As this folder path depends on the server config, you can use PHP to get the home folder. We also recommend you to check the option 'script' to run the transformation as using the PHP CLI mode.

Regards.

Posted by IncodisPM  · 05-05-2016 - 11:10

Hello, 

I know that's quite a late response. But i'm having same problem on my CentOs server which have different user for apache. I checked .config folder in /var/www and it is having full ownership, permission. But still i'm not getting that proper html formatted file. All i'm getting is special characters in html file. 

Even i tried to create other user and give full access, permisssions to .config folder in its home directory, but no luck.

Do we have something more to consider to get proper html file
Thanks!