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


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

[[email protected] ~]$ sudo ./scripts/composer_wrapper.php install --no-dev

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

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?


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?


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

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

if (empty($_POST) && !empty($_SESSION) && !isset($_REQUEST[‘stage’])) {
} 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) {
header(“Location: /”);

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.