I have a php script in which I need to convert doc documents to html files in order to show them in a web page.
I'm doing the conversion with the php command:
exec ( $Command, $Output, $ReturnValue ) ;
where
$Command = "/usr/bin/timeout -s 9 $TimeOut /usr/bin/unoconv -f html -o " . escapeshellarg($Dir) . " " . escapeshellarg($File) ;
Apparently everything works well, but sometimes the process doesn't end, and I remain with hundreds of soffice.bin
, unoconv
, oosplash
processes which waste ram and definitely crash the server.
Am I missing anything?
Is there a better way to invoke unoconv
?
Should I run the unoconv
server as a system service?
I'm using: LibreOffice 3.5, Unoconv 0.5, apache 2.2.22-13+deb7u4