Author Topic: Update_binaries.php does nothing?  (Read 235 times)

Offline houseofdreams

  • Junior Indexer
  • **
  • Posts: 6
  • Helpful: +0/-0
Update_binaries.php does nothing?
« on: 2017-11-09, 01:48:16 PM »
Hi everyone.

I followed this tutorial https://www.linuxbabe.com/ubuntu/set-up-nzedb-usenet-indexer-ubuntu-16-0417-04 to get a fresh install of nzedb. No installation errors, but when I come at the "Indexing Usenet Content" section, something goes wrong, or better said, nothing happens?

Code: [Select]
/var/www/nZEDb/misc/update# nano update_binaries.php
/var/www/nZEDb/misc/update#

It just displays a new empty command line, nothing else happens... The website itself works, so php is working. Anyone that know's where I should look?

Kind regards

Offline ebro

  • Junior Indexer
  • **
  • Posts: 27
  • Helpful: +5/-0
Re: Update_binaries.php does nothing?
« Reply #1 on: 2017-11-09, 03:19:51 PM »
Looks like you have an empty .php file. Mine shows.

<?php
/* Argument 1 is optional string, group name. Or numeric, number of header max to download.
 * Argument 2 is optional int, max number of headers to download.
 */
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bootstrap.php');

use app\models\Settings;
use nzedb\Binaries;
use nzedb\Groups;
use nzedb\NNTP;
use nzedb\db\DB;

$pdo = new DB();

$maxHeaders = Settings::value('max.headers.iteration') ?: 1000000;

// Create the connection here and pass
$nntp = new NNTP(['Settings' => $pdo]);
if ($nntp->doConnect() !== true) {
   exit($pdo->log->error("Unable to connect to usenet."));
}
$binaries = new Binaries(['NNTP' => $nntp, 'Settings' => $pdo]);

if (isset($argv[1]) && !is_numeric($argv[1])) {
   $groupName = $argv[1];
   echo $pdo->log->header("Updating group: $groupName");

   $grp = new Groups(['Settings' => $pdo]);
   $group = $grp->getByName($groupName);
   if (is_array($group)) {
      $binaries->updateGroup($group,
         (isset($argv[2]) && is_numeric($argv[2]) && $argv[2] > 0 ? $argv[2] : $maxHeaders));
   }
} else {
   $binaries->updateAllGroups((isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? $argv[1] :
      $maxHeaders));
}
?>

Offline houseofdreams

  • Junior Indexer
  • **
  • Posts: 6
  • Helpful: +0/-0
Re: Update_binaries.php does nothing?
« Reply #2 on: 2017-11-10, 03:18:12 AM »
File wasn't empty.

I checked another tutorial here on this forum and found that I needed to edit the php7.0 CLI php.ini When I done that, all started working all of a sudden... Strange  :)

Offline david_ritterhous

  • Prolific Indexer
  • ****
  • Posts: 234
  • Helpful: +5/-0
Re: Update_binaries.php does nothing?
« Reply #3 on: 2017-11-10, 02:07:28 PM »
What did you have to change just for future reference?

Offline houseofdreams

  • Junior Indexer
  • **
  • Posts: 6
  • Helpful: +0/-0
Re: Update_binaries.php does nothing?
« Reply #4 on: 2017-11-10, 02:55:49 PM »
What did you have to change just for future reference?

All the changes that where in the tutorial (date.timezone, memory settings and so on)

Offline iredoo

  • Newbie
  • *
  • Posts: 1
  • Helpful: +0/-0
Re: Update_binaries.php does nothing?
« Reply #5 on: 2017-12-06, 09:33:52 AM »
Had the same issue. Like mentioned, you need to edit the php.ini file for CLI.

Code: [Select]
sudo nano /etc/php/7.0/cli/php.ini
The only thing I had to do was find 'timezone' (CTRL-W and then type timezone). Uncomment the line and add the the timezone in (i.e. America/NewYork).

After that, the update_binaries.php file actually does something. Before it would do nothing, no errors or logs.