View Single Post
Old 07-02-2010, 04:02 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ryanlee View Post
echo $XDG_CONFIG_HOME
/root/.config

echo $CALIBRE_CONFIG_DIRECTORY
/home/myhome/.config/calibre


So I did

export XDG_CONFIG_HOME=/home/myhome/.config
export CALIBRE_CONFIG_DIRECTORY=/home/myhome/.config

Then still show me this error
OSError: [Errno 13] Permission denied: '/root/.config


what's wrong?
Are you starting calibre from the process where you did the export?

Export works only for the process doing the export and all sub-processes. If you are using the GUI to start calibre, you will need to set the variable and export it using the GUI environment tool.

However, as you are using PHP, I assume there is a web server involved somewhere. Assuming it is apache, you need to ensure that apache has the correct setting of the environment variable when it starts, so that PHP sees it, so that Calibre sees it. See http://httpd.apache.org/docs/1.3/env.html.

Alternatively, set the environment variable in your PHP script. See 'putenv' in the PHP manual.

Alternatively squared: instead of directly executing a calibre program, exec a shell that sets the environment appropriately, then execs the calibre program.
chaley is offline   Reply With Quote