# Enable Epub export

**URL:** <https://pressbooks.community/t/enable-epub-export/476>\
**Category:** Troubleshooting Installation/Upgrades\
**Created:** [April 11, 2018, 5:21pm UTC](https://pressbooks.community/t/enable-epub-export/476 "2018-04-11T17:21:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ETNA](https://pressbooks.community/letter_avatar_proxy/v4/letter/e/5f9b8f/32.png) [@ETNA](https://pressbooks.community/u/ETNA)\
**Post date:** [April 11, 2018, 5:21pm UTC](https://pressbooks.community/t/enable-epub-export/476/1 "2018-04-11T17:21:22Z")

</div>

Hi,

I want to enable epub export on Pressbooks (on apache2 server).  
Do I need to install the EpubCheck validation tool?  
I read the documentation, but not really understand what to do after I downloaded the EpubCheck from their git account.

thanks a lot!  
Etna

---

<div class="post-metadata">

**Author:** ![ned](https://pressbooks.community/user_avatar/pressbooks.community/ned/32/533_2.png) [@ned](https://pressbooks.community/u/ned)\
**Post date:** [April 11, 2018, 5:27pm UTC](https://pressbooks.community/t/enable-epub-export/476/2 "2018-04-11T17:27:56Z")

</div>

Yes, you do.

Your server needs Java installed. You need to put the `epubcheck.jar` file somewhere where it is accessible, such as `/opt/epubcheck/epubcheck.jar`. In this example, the command to run EpubCheck (`PB_EPUBCHECK_COMMAND` in `wp-config.php` ) will be:

```auto
/usr/bin/java -jar /opt/epubcheck/epubcheck.jar

```

If you run:

```auto
/usr/bin/java -jar /opt/epubcheck/epubcheck.jar -help

```

You should see:

```auto
EpubCheck v4.0.2

When running this tool, the first argument should be the name (with the path)
of the file to check.

...

```

If your server does not support Java, you can bypass the requirement by putting this code in a file (say, `epub.php`) in your `wp-content/mu-plugins/` directory:

```auto
<?php

add_filter( 'pb_epub_has_dependencies', '__return_true' );

```

---

<div class="post-metadata">

**Author:** ![ETNA](https://pressbooks.community/letter_avatar_proxy/v4/letter/e/5f9b8f/32.png) [@ETNA](https://pressbooks.community/u/ETNA)\
**Post date:** [April 16, 2018, 2:49pm UTC](https://pressbooks.community/t/enable-epub-export/476/3 "2018-04-16T14:49:22Z")

</div>

Hi Ned,

Thank you so much for your help, it really worked! and I can export Epub files.  
I try to install KindleGen (added the kindle folder and changed the wp-config as well), but it didn’t work (the checkbox of MOBI option in the export window is disabled)

As an attempt, I deleted the epub and kindle dependencies lines in the wp-config, but the epub checkbox in the export window is still enabled (and I can download my book as an Epub file).  
How can it be possible if I deleted the lines?

really appreciate your help!

---

<div class="post-metadata">

**Author:** ![ned](https://pressbooks.community/user_avatar/pressbooks.community/ned/32/533_2.png) [@ned](https://pressbooks.community/u/ned)\
**Post date:** [April 16, 2018, 3:28pm UTC](https://pressbooks.community/t/enable-epub-export/476/4 "2018-04-16T15:28:50Z")

</div>

> [@ETNA](#):
>
> I deleted the epub and kindle dependencies lines in the wp-config, but the epub checkbox in the export window is still enabled (and I can download my book as an Epub file).

This is probably because we cache the dependency check results. If you [delete your transients](https://wordpress.org/plugins/transients-manager/) you will see that the checkbox is disabled again.
