Use this tutorial to install OpenOffice in Linux, with detailed installation and use Tutorials (http://www.cnblogs.com/sustudy/p/3999628.html) on the page.
Now that you have read the tutorial, you should not deny that Linux has a very deceptive authority. Using PHP to convert Word documents to PDF documents requires a lot of permission settings. So here I give PHP 777 permissions for directories and files.
From this article (http://www.cnblogs.com/sustudy/p/3999628.html) you can clearly know the key code: (below)
Java-jar/usr/local/wenku/jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar/tmp/1.doc/tmp/1.pdf
From the above code, PHP to use the Java command Execution permissions, and/tmp to read and write permissions.
To view the location of the Java command: which Java
Assume that the location of the Java command is:/bin/java
To set 777 permissions for Java: chmod 777/bin/java
Set permissions for the/tmp folder and the following files: Chmod-r 777/tmp
After you have set permissions. You can use the EXEC function of PHP to run the code:JAVA-JAR/USR/LOCAL/WENKU/JODCONVERTER-2.2.2/LIB/JODCONVERTER-CLI-2.2.2.JAR/TMP/1. Doc/tmp/1.pdf
Using PHP in Linux to convert Word documents to PDF