Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 01-10-2023, 11:59 PM   #1
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
OPDS config_local.php

Good morning,

read for now "hundreds" of hints and recommendations but got stuck...

I created a small library (just 124 books) by calibre, edited them and store all books incl the metadata.db in a directory called "calibree".

I copied this directory to my ftp server

Then unpacked COPS on the server in a directory called "cops" - changed the file "config_local.php.example" into "config_local.php" and adressed it as follows:

<?php
if (!isset($config))
$config = array();

/*
************************************************** *
* Please read config_default.php for all possible
* configuration items
************************************************** *
*/

/*
* The directory containing calibre's metadata.db file, with sub-directories
* containing all the formats.
* BEWARE : it has to end with a /
*/
$config['calibre_directory'] = 'calibree/';

/*
* Catalog's title
*/
$config['cops_title_default'] = "COPS";

/*
* use URL rewriting for downloading of ebook in HTML catalog
* See README for more information
* 1 : enable
* 0 : disable
*/
$config['cops_use_url_rewriting'] = "0";

Opened the check.config and get the following result:



May someone please tell me what is my mistake?

Thanks very much in advance,
Peter
huber70 is offline   Reply With Quote
Old 01-11-2023, 06:39 AM   #2
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@huber70

You are nearly there!

To make it work it depends on the PATH to the "calibree" directory.
2 examples:

1 - you place the "calibree" directory in the root of your server:
$config['calibre_directory'] = '/calibree/';

2 - you place the "calibree" directory as a subdirectory of COPS:
$config['calibre_directory'] = './calibree/';

Hope this helps you.
mariosipad is offline   Reply With Quote
Advert
Old 01-11-2023, 06:47 AM   #3
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
Thanks for reply,

unfortunately, both solutions do not work:

Check if Calibre database file exists and is readable
File /calibree/metadata.db not found, Please check
huber70 is offline   Reply With Quote
Old 01-11-2023, 06:55 AM   #4
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@huber70

Just to test, place the calibree directory inside the COPS directory:
$config['calibre_directory'] = './calibree/';

Make sure the calibree directory and all files inside it are readable.
mariosipad is offline   Reply With Quote
Old 01-11-2023, 11:17 AM   #5
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
@mariosipad

thanks a lot, that works...

Any idea, why it does not work with "calibree" in the server's root?

Last edited by huber70; 01-11-2023 at 11:26 AM.
huber70 is offline   Reply With Quote
Advert
Old 01-11-2023, 11:30 AM   #6
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@huber70

1 - no covers: have you installed all necessary php modules?

php7.4 php7.4-xml php7.4-mbstring php7.4-zip php7.4-gd php7.4-sqlite3 php7.4-json php7.4-intl

Probably: yes

Can you download books to your reader?


2 - server root Possibly not allowed by server. What server are you using?
mariosipad is offline   Reply With Quote
Old 01-11-2023, 11:58 AM   #7
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
@mariosipad

sorry, I edited my contribution: I made a mistake to copy the files using total commander and did not realize, that I am not able to copy within the server's directories.. At least, I just saw the folders, but they were empty. As COPS reads the metadata.db and depicts the amount of books I thought that things are right...

Servers rights are all 777 (server is IONOS) php is 7.4.33

I received a message today from server IONOS that since 11/2022 php 7.4 is no longer supported and I have to switch to the next version (8?), till 2nd of april 2023, otherwise I have to pay 8.50 $ per month for keeping version 7.4.
I read in this forum (?) that php 8 does not work for COPS...
huber70 is offline   Reply With Quote
Old 01-11-2023, 01:01 PM   #8
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@huber70

So if you can copy all the subdirectories into ./cops/calibree it should work. And does it?

For COPS and calibre directories I usually use 755 (not 777).

Yeah, php7.4 seems to be end-of-life, but $ 8.50/month seems excessive to me.

You have a few options:
1 - if you have your webpage at a hoster only for COPS and a few other simple projects >> find a hoster that will support php 7.4 for now.
2 - try the solution from this post (https://www.mobileread.com/forums/sh...postcount=1890) and see if it works. I have tested it with php 8.0 but never with php 8.1 or 8.2. Maybe I should..... .... if only for my own server.
3 - host COPS yourself. If you have an old PC install Debian 11 on it with apache and php7.4. A Raspberry Pi or comparable device will work as well.

If you use the webhoster don't forget to place your COPS behind a [username/password]. Copyright Laws in Germany are enforced. Behind a username/password you are better protected.
mariosipad is offline   Reply With Quote
Old 01-11-2023, 01:41 PM   #9
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
@mariosipad

COPS works fine after copying all subdirectories/metadata.db into ./cops/calibree, incl covers & downloads

First of all I have to check the userbility of COPS, until now I prefer Calibre2opds due to its various adjustments - COPS is interesting for me as it has a search function...

After test run I will try the solution 2), as I have to switch the php version for my website

And: Of course COPS is hidden behind username/password as Calibre2opds is ;-)

Again: Thanks for your assistance, highly appreciated
huber70 is offline   Reply With Quote
Old 01-11-2023, 02:47 PM   #10
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@huber70

Did a quick test with php8.1 and solution 2 and it seems to work OK!

The main advantage of COPS is that it can handle multiple calibre databases at the same time (even search through all of them). If interested I can give an example to you.
mariosipad is offline   Reply With Quote
Old 01-11-2023, 04:16 PM   #11
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
@mariosipad

I am very interested in search possibilities eg: If I search for "king" within authors result is "king, stephen" as well as "king, owen" and or "berking, anna" - could the search be restricted?

Skins: Any chance to modify the colors and icons? Just change the icons within the cops-directory?
huber70 is offline   Reply With Quote
Old 01-11-2023, 05:07 PM   #12
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@huber70

Search for Stephen King.

You can program your own skins if you want. I tried but failed.
There are no simple settings to change the look of COPS.
mariosipad is offline   Reply With Quote
Old 01-11-2023, 05:30 PM   #13
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
@mariosipad

ok, search function works - in my case necessarily king, stephen

is it necessary to copy the metadata.opf file to "calibree" directory and each subfolder? I guess, the cover.jpg is necessary (or not?)
huber70 is offline   Reply With Quote
Old 01-11-2023, 06:17 PM   #14
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 723
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@huber70

Stephen King gives jou King, Stephen as well.

I copy the entire calibre directory (./calibree) to the server including all the subdirectories and files (ePub, jpg, etc) . It's a good backup. Copying a subset of all the files is more work.
mariosipad is offline   Reply With Quote
Old 01-12-2023, 02:19 AM   #15
huber70
Addict
huber70 has learned how to buy an e-book online
 
Posts: 274
Karma: 96
Join Date: Nov 2017
Location: Germany
Device: Tolino Vision6
@mariosipad

guess I was too curious:

On serverside I switched to php 8.1 after checking my several websites - they all work fine
(Zeta Producer = Website builder supports php 8.1)

After that I included the code snip (post 1890) but now receive a blank page...

last lines are:

return @function ($it) use ($func) {
eval($func);
};
}

public function execute ($data) {
return $this->functionCode ($data);
}

}

Any mistake Imade?
huber70 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
COPS : Calibre OPDS PHP Server vlad59 Related Tools 1920 11-03-2024 02:52 PM
OPDS in php or populate metadata.db from filesystem skelos Related Tools 0 09-06-2019 12:03 PM
php??? crutledge ePub 13 01-24-2014 07:27 PM
Which PHP version do you have? erayd Workshop 2 10-04-2010 09:02 PM


All times are GMT -4. The time now is 08:27 PM.


MobileRead.com is a privately owned, operated and funded community.