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

Installing on Ubuntu 16-04 LTS (with php7) #319

Closed philfx closed 7 years ago

philfx commented 7 years ago

Hi,

Thanks for this software. I can't get it work but I really want to - I have a tons of ebooks that I want to provide online. I have a lot of expectations :)

I did a apt-get install php7.0-intl php7.0-sqlite3 because a composer error message. Composer run correctly after that.

Lauching COPS gave me :

You've been redirected because COPS is not configured properly Database error Check if PHP version is correct OK (7.0.8-0ubuntu0.16.04.3) Check if GD is properly installed and loaded OK Check if Sqlite is properly installed and loaded Please install the php5-sqlite extension and make sure it's enabled Check if libxml is properly installed and loaded OK Check if Json is properly installed and loaded OK Check if mbstring is properly installed and loaded OK Check if intl is properly installed and loaded Please install the php5-intl extension and make sure it's enabled Check if Normalizer class is properly installed and loaded Please make sure intl is enabled in your php.ini Check if the rendering will be done on client side or server side Client side rendering Check if Calibre database path is not an URL OK Check if Calibre database file exists and is readable File /home/www/uniag.ch/cops/files/metadata.db not found, Please check

By the way, I maybe didn't understand correctly for what COPS is for. My goal was to set up a calibre server and access it from everywhere. Maybe COPS is only for connecting an existing calibre database a provide the content. The file "metadata.db" doesn't exist anyway, neither on COPS path, nor in my Calibre installation.

What can I do ?

Thanks in advance,

PS: vous pouvez répondre en français, mais pour que tout le monde puisse en profiter j'ai préféré écrire en anglais ;)

horus68 commented 7 years ago

COPS is only for connecting an existing calibre database a provide the content

Yes its true.

The metadata.db its created by Calibre after adding some ebooks to a Calibre library. A calibre library is created inside an empty folder (library folder) and managed by calibre only. You need Calibre to add books and edit metadata (title, covers and so on).
A Calibre library is composed by one folder for each author, one folder for each title and the ebook and cover files for each title). All contents on that top folder are created by calibre, no direct edits from you.

Then you need to upload that calibre library folder (including metadata.db and all the folders and files) to a folder on your server. Then in COPS you need to place the path to that folder in the config_local.php (see config_default.php for details. Done!

philfx commented 7 years ago

Okay, thanks ! Done. But still the errors messages above :

You've been redirected because COPS is not configured properly Database error Check if PHP version is correct OK (7.0.8-0ubuntu0.16.04.3) Check if GD is properly installed and loaded OK Check if Sqlite is properly installed and loaded Please install the php5-sqlite extension and make sure it's enabled Check if libxml is properly installed and loaded OK Check if Json is properly installed and loaded OK Check if mbstring is properly installed and loaded OK Check if intl is properly installed and loaded Please install the php5-intl extension and make sure it's enabled Check if Normalizer class is properly installed and loaded Please make sure intl is enabled in your php.ini Check if the rendering will be done on client side or server side Client side rendering Check if Calibre database path is not an URL OK Check if Calibre database file exists and is readable OK Check if Calibre database file can be opened with PHP If the file is readable, check your php configuration. Exception detail : PDOException: could not find driver in /home/www/uniag.ch/cops/checkconfig.php:203 Stack trace: #0 /home/www/uniag.ch/cops/checkconfig.php(203): PDO->construct('sqlite:/home/ww...') #1 {main} Check if Calibre database file contains at least some of the needed tables If the file is readable, check your php configuration. Exception detail : PDOException: could not find driver in /home/www/uniag.ch/cops/checkconfig.php:216 Stack trace: #0 /home/www/uniag.ch/cops/checkconfig.php(216): PDO->construct('sqlite:/home/ww...') #1 {main}

And as said, php7.0-intl php7.0-sqlite3 are installed. Looks like it does not work with php7.

dannyb78 commented 7 years ago

same problem here:

checkconfig

COPS CONFIGURATION CHECK Check if PHP version is correct OK (7.0.13-0ubuntu0.16.04.1) Check if GD is properly installed and loaded OK Check if Sqlite is properly installed and loaded OK Check if libxml is properly installed and loaded OK Check if Json is properly installed and loaded OK Check if mbstring is properly installed and loaded OK Check if intl is properly installed and loaded OK Check if Normalizer class is properly installed and loaded OK Check if the rendering will be done on client side or server side Client side rendering Check if Calibre database path is not an URL OK Check if Calibre database file exists and is readable OK Check if Calibre database file can be opened with PHP OK Check if Calibre database file contains at least some of the needed tables OK

phpinfo

PHP Version 7.0.13-0ubuntu0.16.04.1

System Linux server 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php/7.0/apache2 Loaded Configuration File /etc/php/7.0/apache2/php.ini Scan this dir for additional .ini files /etc/php/7.0/apache2/conf.d Additional .ini files parsed /etc/php/7.0/apache2/conf.d/10-mysqlnd.ini, /etc/php/7.0/apache2/conf.d/10-opcache.ini, /etc/php/7.0/apache2/conf.d/10-pdo.ini, /etc/php/7.0/apache2/conf.d/20-calendar.ini, /etc/php/7.0/apache2/conf.d/20-ctype.ini, /etc/php/7.0/apache2/conf.d/20-exif.ini, /etc/php/7.0/apache2/conf.d/20-fileinfo.ini, /etc/php/7.0/apache2/conf.d/20-ftp.ini, /etc/php/7.0/apache2/conf.d/20-gd.ini, /etc/php/7.0/apache2/conf.d/20-gettext.ini, /etc/php/7.0/apache2/conf.d/20-iconv.ini, /etc/php/7.0/apache2/conf.d/20-intl.ini, /etc/php/7.0/apache2/conf.d/20-json.ini, /etc/php/7.0/apache2/conf.d/20-mbstring.ini, /etc/php/7.0/apache2/conf.d/20-mysqli.ini, /etc/php/7.0/apache2/conf.d/20-pdo_mysql.ini, /etc/php/7.0/apache2/conf.d/20-pdo_sqlite.ini, /etc/php/7.0/apache2/conf.d/20-phar.ini, /etc/php/7.0/apache2/conf.d/20-posix.ini, /etc/php/7.0/apache2/conf.d/20-readline.ini, /etc/php/7.0/apache2/conf.d/20-shmop.ini, /etc/php/7.0/apache2/conf.d/20-sockets.ini, /etc/php/7.0/apache2/conf.d/20-sqlite3.ini, /etc/php/7.0/apache2/conf.d/20-sysvmsg.ini, /etc/php/7.0/apache2/conf.d/20-sysvsem.ini, /etc/php/7.0/apache2/conf.d/20-sysvshm.ini, /etc/php/7.0/apache2/conf.d/20-tokenizer.ini PHP API 20151012 PHP Extension 20151012 Zend Extension 320151012 Zend Extension Build API320151012,NTS PHP Extension Build API20151012,NTS Debug Build no Thread Safety disabled Zend Signal Handling disabled Zend Memory Manager enabled Zend Multibyte Support provided by mbstring IPv6 Support enabled DTrace Support enabled Registered PHP Streams https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2 Registered Stream Filters zlib., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, convert.iconv.*

seblucas commented 7 years ago

@dannyb78 and @philfx You don't have the same problem (it seems so).

@dannyb78

Check if Sqlite is properly installed and loaded OK

@philfx

Check if Sqlite is properly installed and loaded Please install the php5-sqlite extension and make sure it's enabled

So I guess everything should be working fine for dannyb78.

I can confirm that COPS is working with PHP7 but I don't know why installing both php7.0-intl and php7.0-sqlite3 does not enable them in the php.ini / conf.d. I never used Ubuntu in my life (more a Debian guy), I'll setup an Ubuntu Docker image and try to test.

seblucas commented 7 years ago

Could you give the output of php -r 'phpinfo();' | grep -i pdo

In my case (Debian Jessie with PHP 5.6) :

/etc/php5/cli/conf.d/10-pdo.ini,
/etc/php5/cli/conf.d/20-pdo_sqlite.ini,
PDO
PDO support => enabled
PDO drivers => sqlite
pdo_sqlite
PDO Driver for SQLite 3.x => enabled

Did you have any older PHP before installing PHP7 ?

philfx commented 7 years ago

Here is the result of php -r 'phpinfo();' | grep -i pdo

/etc/php/7.0/cli/conf.d/10-pdo.ini, /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini, /etc/php/7.0/cli/conf.d/20-pdo_sqlite.ini, API Extensions => mysqli,pdo_mysql PDO PDO support => enabled PDO drivers => mysql, sqlite pdo_mysql PDO Driver for MySQL => enabled pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock pdo_sqlite PDO Driver for SQLite 3.x => enabled

It's a fresh install. Ubuntu is mostly build on Debian packages.

seblucas commented 7 years ago

I'm beginning to be out of answers ....

Did you try restart your webserver / the complete server ?

mbirth commented 7 years ago

@philfx Did you also install libapache2-mod-php7.0? Did you restart Apache after installing the PDO extensions? Did you install php7.0-pdo, too? And php7.0-pdo-sqlite? Also check for the files 10-pdo.ini and 20-pdo_sqlite.ini in the /etc/php/7.0/apache2/conf.d/ directory. These are the configs for the Apache web server. The configs for the commandline php are in ..../cli/conf.d/, so they might differ.

philfx commented 7 years ago

@mbirth : Yes, apt-get install php7.0-pdo php7.0-pdo-sqlite is ok (no new packages).

I didn't restart apache myself, it's the job of apt-get after installing a package... I did it now, and it Works :dancer: Holy shit, beginner's problem. It's a production serveur and I'm not used to restart it.

So, solution for installing on Ubuntu 16.04 :

apt-get install php7-gd php7-json php7.0-intl php7.0-xml php7-json php7.0-common php7.0-sqlite3

and RESTART apache after that.

I'll close the case (most cases are not closed here, maybe they should...). No other problems, everything is fine :+1:

Thanks a lot !!