Web検索はbingがおすすめ!

Cacti アップデート時に "Failed opening './lib/ldap.php'" エラーが表示される

現象

Cactiのアップデート時に、以下のエラーメッセージが表示されます。
エラーメッセージ
PHP Warning: include_once(./lib/ldap.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\cacti\auth_login.php on line 26 PHP Warning: include_once(): Failed opening './lib/ldap.php' for inclusion (include_path='.;C:\php\pear') in C:\inetpub\wwwroot\cacti\auth_login.php on line 26



なお、リモートからのアクセスの場合、500エラーになります。

原因

インストール時のみ相対ディレクトリの位置関係で、ldap.php の参照位置が違ってしまうためのようです。
 

対処方法

auth_login.php を修正します。
'./lib/ldap.php''../lib/ldap.php' に変更します。
補足
インストールが終わったら元に戻します。
変更前
<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2004-2020 The Cacti Group                                 |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
 | Cacti: The Complete RRDtool-based Graphing Solution                     |
 +-------------------------------------------------------------------------+
 | This code is designed, written, and maintained by the Cacti Group. See  |
 | about.php and/or the AUTHORS file for specific developer information.   |
 +-------------------------------------------------------------------------+
 | http://www.cacti.net/                                                   |
 +-------------------------------------------------------------------------+
*/

/* include ldap support */
include_once('./lib/ldap.php');
変更後
<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2004-2020 The Cacti Group                                 |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
 | Cacti: The Complete RRDtool-based Graphing Solution                     |
 +-------------------------------------------------------------------------+
 | This code is designed, written, and maintained by the Cacti Group. See  |
 | about.php and/or the AUTHORS file for specific developer information.   |
 +-------------------------------------------------------------------------+
 | http://www.cacti.net/                                                   |
 +-------------------------------------------------------------------------+
*/

/* include ldap support */
include_once('../lib/ldap.php');

確認

ファイルの修正後アクセスすると、エラーが発生せずに表示できます。

著者
iPentecのプログラマー、最近はAIの積極的な活用にも取り組み中。
とっても恥ずかしがり。
掲載日: 2020-09-29
iPentec all rights reserverd.