I'm using docx2txt to extract .docx
contents.
I can achieve this by running the shell script in terminal.
below is the Terminal
shell script,
niveus@niveus:/var/www/docx2txt$ ./docx2txt.sh test.docx
Text extracted from <test.docx> is available in <test.txt>.
But I want to run this script with php as well.
I tried this,
<?php
$docxFilePath = "test.docx";
echo $content = shell_exec('./docx2txt.sh '.escapeshellarg($docxFilePath));
?>
and it outputs Failed to extract text from !
(both docx2txt.sh
and test.txt
are in the same folder docx2txt
)