View Single Post
Old 01-22-2015, 06:30 PM   #1
tigran
Zealot
tigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
ebook-meta fails when used via Apache web server

When I execute ebook-meta on a mobi or epub files as a normal user it shows the metadata (and --get-cover extracts the cover) absolutely fine, but if I try to run it from within a PHP script (on Apache 2.4.10) it fails like this:

No cover found
Title : Unknown
Author(s) : Unknown

I.e. reports no cover and "Unknown" values for Title and Author. When executed as a normal user it shows not only the correct Title and Author but also Publisher, Languages, Published and Rights fields.

Any idea what may be wrong? I am using version 0.9.6. I didn't forget to set up the environment variables

export CALIBRE_CONFIG_DIRECTORY=/var/www/public_html/site/calibre
export CALIBRE_TEMP_DIR=/tmp

Should I set up something else as well? I am guessing that it is some kind of permission issue which makes it different when run as user daemon, group daemon...

I forgot to mention that I am running Fedora Core 17, which is why I didn't use the latest calibre (from source) --- its dependencies cannot be brought back to Fedora 17 (at least I couldn't, but maybe that was because I am not a python programmer, but a C programmer (Linux kernel developer)).

I did strace -o log of both invocations (via normal user and from PHP script) and see that the difference seems to be that immediately after opening the book in the failing case it does NOT even look for the file "/usr/lib64/calibre/calibre/ebooks/metadata/mobi.py" (and mobi.pyc) whereas in the working case it opens this file ok.

So, I need to find out what it is (some environment variable?) that controls whether to look for "mobi.py" or not.

Last edited by tigran; 01-23-2015 at 03:42 AM.
tigran is offline   Reply With Quote