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

/vendor/autoload.php missing ? #399

Closed andrepradotf closed 5 years ago

andrepradotf commented 6 years ago

I'm getting this error on apache logs [Thu Jun 28 2018] [:error] [pid 3342] [client] PHP Warning: require_once(/var/www/html/sex.com/public_html/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/sex.com/public_html/config.php on line 9

seblucas commented 6 years ago

Can you be a little more specific ?

andrepradotf commented 6 years ago

described at the description...

seblucas commented 6 years ago

That was empty a second ago ;). Did you follow the instruction in README.md ? Did you install from git or with the zip provided in the releases ?

andrepradotf commented 6 years ago

I did. From git. I didn't see this /vendor directory anywhere... am I that stupid?

seblucas commented 6 years ago

What was the output from :

php composer.phar global require "fxp/composer-asset-plugin:~1.1"
php composer.phar install --no-dev --optimize-autoloader
andrepradotf commented 6 years ago

Could not open input file: composer.phar

seblucas commented 6 years ago

then the download of composer failed did you check the error ?

andrepradotf commented 6 years ago

it doesn't display any error dowloading... just after try to browse, it can't display anything and I get that error at apache logs...

seblucas commented 6 years ago

please go to the install directory where you installed COPS and retry all commands starting with wget .... and please post the full output, it's hard to help if you don't also help.

andrepradotf commented 6 years ago

okay, wait a sec

andrepradotf commented 6 years ago

root@cpu:/var/www/html/domain.tk/public_html# apt-get install php7.0-gd php7.0-sqlite3 php7.0 -json php7.0-intl php7.0-xml php7.0-mbstring php7.0-zip Reading package lists... Done Building dependency tree Reading state information... Done php7.0-gd is already the newest version (7.0.27-0+deb9u1). php7.0-intl is already the newest version (7.0.27-0+deb9u1). php7.0-json is already the newest version (7.0.27-0+deb9u1). php7.0-mbstring is already the newest version (7.0.27-0+deb9u1). php7.0-sqlite3 is already the newest version (7.0.27-0+deb9u1). php7.0-xml is already the newest version (7.0.27-0+deb9u1). php7.0-zip is already the newest version (7.0.27-0+deb9u1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. root@cpu:/var/www/html/domain.tk/public_html# git clone https://github.com/seblucas/cops.git Cloning into 'cops'... remote: Counting objects: 7038, done. remote: Compressing objects: 100% (56/56), done. remote: Total 7038 (delta 15), reused 39 (delta 0), pack-reused 6982 Receiving objects: 100% (7038/7038), 6.30 MiB | 3.60 MiB/s, done. Resolving deltas: 100% (4152/4152), done. root@cpu:/var/www/html/domain.tk/public_html# cp cops/config_local.php.example cops/config_lo cal.php root@cpu:/var/www/html/domain.tk/public_html# nano cops/config_local.php root@cpu:/var/www/html/domain.tk/public_html# cat cops/config_local.php <?php if (!isset($config)) $config = array();

$config['calibre_directory'] = '/home/user/';

$config['cops_title_default'] = "COPS";

$config['cops_use_url_rewriting'] = "0";

root@cyla:/var/www/html/insekta.tk/public_html# mkdir -p /home/user

andrepradotf commented 6 years ago

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

$config['calibre_directory'] = '/home/user/';

$config['cops_title_default'] = "COPS";

$config['cops_use_url_rewriting'] = "0";

root@cpu:/var/www/html/domain.tk/public_html# mkdir -p /home/user

seblucas commented 6 years ago

You should follow the README : https://github.com/seblucas/cops/blob/master/README.md#install-from-sources

seblucas commented 6 years ago

If you want to use it like you did, then download this : https://github.com/seblucas/cops/releases/download/1.1.2/cops-1.1.2.zip

seblucas commented 6 years ago

And storing your Calibre library in /home is usually a bad idea due to the access rights set by default in this directory

andrepradotf commented 6 years ago

I will change to /var/ then. How is the metadata.db created? now I get another errors. Database error now.

andrepradotf commented 6 years ago

should I have calibre installed to run this?

Shadowghost commented 6 years ago

You need to create a database with Calibre (you put your books with calibre into this database on e.g. your computer and afterwards you upload it to your webspace), This database you can use with cops. cops does not create any database, it's more like a "frontend-server" for a calibre database. Please read the documentation, before using...

seblucas commented 6 years ago

I agree with @Shadowghost , please read the documentation

andrepradotf commented 6 years ago

can I create this database using calibre for windows and use it on linux? I don't have graphical environment on my server... I think it is necessary for calibre linux version. Sorry about my lack of information.

seblucas commented 6 years ago

Exactly, that's how COPS is supposed to be used. You create / manage your Calibre library on your laptop, you sync your Calibre library from your laptop to your server running COPS. And you can use COPS on your lan.

horus68 commented 6 years ago

@andrepradotf please test things locally to be able to learn. 1- Install Calibre on your Windows personal computer https://calibre-ebook.com/ 2- Create a new Calibre library on your computer (any location) as in D:\ebooks\library01\ 3- Upload some books to Calibre, edit the book metadata (minimal is title, autor, date) 4- Install a local web server in your computer ( Wampp http://www.wampserver.com/ or XAMPP https://www.apachefriends.org ). Those will give you a local server to play and test your sites! 5- Verify if the local server is working with a plain html file! as in http://localhost/ Note: trying to have a server online without first using a local server for testing and learn its a road to disaster! 6- Create a new folder (any name without spaces) for COPS in the web root in your local test server. (as in D:\wamp\www\mycopslibrary). This will be your COPS Website (later you will copy that folder into your online server) 7- Install Cops into local web server (just unzip files in to D:\wamp\www\mycopslibrary ) 8- Copy the Calibre library (books and metadata.db) into a new folder (any name) inside your local COPS website, as in D:\wamp\www\mycopslibrary\myebooks ) Note: you can have any name and location for the folder. When moving to a server you can easily move it to a different folder on your server. 9- Configure Cops to work with your Calibre copied library change the config in config_local.php including the location of your library with: $config['calibre_directory'] = 'mylibrary01/'; Note the ending / 10- Open Cops in your browser (as in localhost://mycopslibrary/, play with things, see the errors when navigating the Calibre. 11- Go back to Calibre edit again your ebooks metadata, copy all changed folders and files from Calibre library ( D:\ebooks\library01\ ) into your Cops site Calibre ebook folder (D:\wamp\www\mycopslibrary\myebooks ) 12- Look into a mirror? Are you happy? 13- Then its time to go online and copy D:\wamp\www\mycopslibrary\ into your server web root! Note: 13 can be a lucky number!

Also you need to read the FAQ: https://github.com/seblucas/cops/wiki Maybe you will not complete this in a single day but you will gain many days in your life!

Zoldex commented 5 years ago

Hi, I do have similar message: Warning: require_once(/volume1/web/cops/vendor/autoload.php): failed to open stream: No such file or directory in /volume1/web/cops/config.php on line 9 Fatal error: require_once(): Failed opening required '/volume1/web/cops/vendor/autoload.php' (include_path='.:/usr/syno/php/lib/php') in /volume1/web/cops/config.php on line 9

Cops is actually on my synology web server, and it worked fine with pre-v1 versions (i believe). The very same behaviour is on a rented web server on the net. I suspect could be the composer component but i really don't understand how can i install it... Any help?

seblucas commented 5 years ago

Can you read https://github.com/seblucas/cops/issues/399#issuecomment-401161152 and https://github.com/seblucas/cops/issues/399#issuecomment-401161328

You have to use the release zip and not directly master

Zoldex commented 5 years ago

Can you read #399 (comment) and #399 (comment)

You have to use the release zip and not directly master

Many thanks, I didn't notice the difference... I found another strange behaviour, but will open a new thread.