seblucas / cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
1.43k stars 229 forks source link

COPS on Synology DSM 6.1 #332

Closed iostrym closed 7 years ago

iostrym commented 7 years ago

Hi,

I'm trying to set up COPS on my Synology with DSM 6.1

I followed the Howto Synology without success.

zend_extension = opcache.so extension = apcu.so

date.timezone = Europe/Amsterdam display_errors = Off open_basedir = /tmp:/var/services/tmp:/var/services/web:/var/services/homes:/volume2/ebook:/var/services/web/cops/calibre_database_test

I edit it via SSH (even if during cops installation gui asked me the path) : /var/service/web/cops/config_local.php to that:

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

/*
 * The directory containing calibre's metadata.db file, with sub-directories
 * containing all the formats.
 * BEWARE : it has to end with a /
 */
// second test with a directory inside cops directory => checkconfig.php works but blank page in 102.168.1.50/cops (title of the page is the correct title:COPS_test
//$config['calibre_directory'] = './calibre_database_test/';

// first try : checkconfig never works $config['calibre_directory'] = '/volume2/ebook/'; /*

1 - I don't know why but there is another cops directory with same files (that don't seems to be used): /volume2/@appstore/cops/share/cops/config_local.php

2 - When I open http://192.168.1.50/cops/checkconfig.php using my official database in /volume2/ebook/ => Check if Calibre database file exists and is readable File ./metadata.db not found, Please check

Value of $config['calibre_directory'] in config_local.php
Value of open_basedir in your php.ini
The access rights of the Calibre Database
Synology users please read this

=> I add all user access to the shared folder ebook, I add http (it was already added i think) user to the sharel folder, etc. I don't succeed to make it works.

3 - If I modify the config_local.php using a calibre_database_test database inside /var/service/web/cops directory, then checkconfig.php is working BUT I have a blank page on http://192.168.1.50/cops and the title of the page is correct : COPS_test (tried with 3 browser : same result).

On the synology, nothing special installed. only classical stuff ds_audio, ds_photo, office, etc... a chmod -R 777 on the calibre database inside cops directory makes checkconfig.php working. but a chmod -R 777 on the cops directory itself don't resolve the blank page problem... tried rebooting several time the NAS without success...

4 - It was said in the howto Synology to configure php.ini file but on my synology no php.ini stored open_basedir. Only ./usr/syno/etc/packages/WebStation/php56/conf.d/user_settings.ini stored the value configured in the GUI of Synology.

I see 4 problems. Are these known issues with use of DSM 6.1 ?

Thanks a lot for your help. It has been about one week I'm looking for a solution and trying many stuff but without any success. I don't know PHP or web station so maybe i did a very simple mistake...

hugoheitz commented 7 years ago

Hi,

I have a Synology and DSM6.1 with COPS working on it.

I check what I have first in the open_basedir on webstation / PHP parameters /volume1/calibre/

Did you try with a / at the end ?

iostrym commented 7 years ago

I will try. => [edit] : tried but without success.

But I remember reading the / at the end As not needed for open_basesir. You put this path on start of open_basedir ? Or at the end ? Did you install like me cops from synocommunity ? I succeeded to make working cops using apache server instead of nginx (default server on webstation) -> resolve problem 3 but only with a database located in cops directory. Not in shared folder. Is there a problem because of synocommuties package giving access to calibre dadabase to http user instead of http group ?

[EDIT] : I made another test: it is working if database is moved in /tmp directory (with chmod 777). (ps: /tmp directory is already present in open_basedir). It acts as if my configuration of open_basedir wasn't applied.

iostrym commented 7 years ago

reading some post on the web I found the solution: manual modification of open_basedir in : /usr/local/etc/php56/conf.d/user_settings.ini

and after a reboot (before rebooting => no change) => it works !!! (about one weeks on this problem...)

I don't know why synology config in webstation don't edit the correct file. If you know it, I am very interested...

hugoheitz commented 7 years ago

Answers : I put the path at the end of open_basedir. I installed cops from synocommunity but when I was on DSM5.1 and upgraded to DSM 6 after...

Maybe it would be useful to open a ticket in synology support to inform them about this behavior.

iostrym commented 7 years ago

me too: upgrade to DSM 6 and then 6.1 Maybe the upgrade put a mess in php installation...