Using PHP in Linux to convert Word documents to PDF

Source: Internet
Author: User
Tags tmp folder

Use this tutorial to install OpenOffice in Linux, with detailed installation and use Tutorials ( 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 ( you can clearly know the key code: (below)


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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.