Could not open input file: /opt/librenms/composer.phar

Hello,

Trying a new install got the error below after git clone:
./scripts/composer_wrapper.php install --no-dev

Could not open input file: /opt/librenms/composer.phar

Run with sudo/as root

[librenms@dfw-l-nms1-01 ~]$ sudo ./scripts/composer_wrapper.php install --no-dev

[sudo] password for librenms:
Could not open input file: /opt/librenms/composer.phar
[librenms@dfw-l-nms1-01 ~]$ ls -ltr /opt/librenms/composer.phar
ls: cannot access ‘/opt/librenms/composer.phar’: No such file or directory
[librenms@dfw-l-nms1-01 ~]$

it appears that composer.phar is missing from the git repo.

Umh…comproser_wrapper.php script should install it…

that’s what I was expecting, but after looking inside composer_wrapper, it looks for composer.phar as an input. which is missing.

@murrant any place I can get composer.phar?

@famahmou

I told you. composer_wrapper.php should install it if not found. If its not installing there is an issue with your permissions/installation.

I’ve installed yesterday a dev librenms and had the same issue which was fixed running it with sudo.

Make sure all permissions are correct and you have internet connectivity in that box.

@TheGreatDoc sudo did not work. but I got around this with removing /opt/librenms dir and did a fresh git clone. after this with double checking the permissions I was able to run composer_wrapper.php successfully.

now I got another issue running the http://localhost/install.php the page loads a raw php txt and not a the install page.
vhost configured properly and dir set to /opt/librenms/html/
owner also set to librenms:librenms on /opt/librenms/html/

anything I missed?

<?php

use LibreNMS\Authentication\LegacyAuth;
use LibreNMS\Config;

session_start();
$librenms_dir = realpath(DIR . ‘/…’);

if (empty($_POST) && !empty($_SESSION) && !isset($_REQUEST[‘stage’])) {
$_POST = $_SESSION;
} elseif (!file_exists("{$librenms_dir}/config.php")) {
$allowed_vars = array(‘stage’,‘build-ok’,‘dbhost’,‘dbuser’,‘dbpass’,‘dbname’,‘dbport’,‘dbsocket’,‘add_user’,‘add_pass’,‘add_email’);
foreach ($allowed_vars as $allowed) {
if (isset($_POST[$allowed])) {
$_SESSION[$allowed] = $_POST[$allowed];
}
}
}

$stage = isset($_POST[‘stage’]) ? $_POST[‘stage’] : 0;

// Before we do anything, if we see config.php, redirect back to the homepage.
if (file_exists("{$librenms_dir}/config.php") && $stage != 6) {
unset($_SESSION[‘stage’]);
header(“Location: /”);
exit;
}

php is not enabled.

Are you running apache or nginx? if apache, remember to a2enmod mod_php, if nginx configure php-fpm

using Apache, re-installed mod_php resolved the issue.

Thanks!