0

I've just installed cacti-1.2.12 from source on a Centos 8. After completed the installation, always that I change among tabs, cacti logs show:

2020-05-07 19:28:17 - CMDPHP PHP ERROR WARNING Backtrace: (/clog.php[27]:include(), /include/auth.php[28]:require_once(), /include/global.php[444]:cacti_session_start(), /lib/functions.php[5541]:session_name(), CactiErrorHandler())
2020-05-07 19:28:17 - ERROR PHP : session_name(): Cannot change session name when session is active in file: /apps/cacti-1.2.12/lib/functions.php on line: 5541
2020-05-07 19:28:17 - CMDPHP PHP ERROR WARNING Backtrace: (/clog.php[27]:include(), /include/auth.php[28]:require_once(), /include/global.php[405]:ini_set(), CactiErrorHandler())
2020-05-07 19:28:17 - ERROR PHP : ini_set(): A session is active. You cannot change the session module's ini settings at this time in file: /apps/cacti-1.2.12/include/global.php on line: 405
2020-05-07 19:28:17 - CMDPHP PHP ERROR WARNING Backtrace: (/clog.php[27]:include(), /include/auth.php[28]:require_once(), /include/global.php[396]:ini_set(), CactiErrorHandler())
2020-05-07 19:28:17 - ERROR PHP : ini_set(): A session is active. You cannot change the session module's ini settings at this time in file: /apps/cacti-1.2.12/include/global.php on line: 396
2020-05-07 19:28:17 - CMDPHP PHP ERROR WARNING Backtrace: (/clog.php[27]:include(), /include/auth.php[28]:require_once(), /include/global.php[395]:ini_set(), CactiErrorHandler())
2020-05-07 19:28:17 - ERROR PHP : ini_set(): A session is active. You cannot change the session module's ini settings at this time in file: /apps/cacti-1.2.12/include/global.php on line: 395
2020-05-07 19:28:17 - CMDPHP PHP ERROR WARNING Backtrace: (/clog.php[27]:include(), /include/auth.php[28]:require_once(), /include/global.php[394]:ini_set(), CactiErrorHandler())
2020-05-07 19:28:17 - ERROR PHP : ini_set(): A session is active. You cannot change the session module's ini settings at this time in file: /apps/cacti-1.2.12/include/global.php on line: 394

the php.ini (only session config) is:

session.save_handler = files
session.save_path = "/apps/php/var/lib/php/session/"
session.use_strict_mode = 1
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 1
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5

How can i avoid the flooding of logs with these errors?

thanks

Fredegar
  • 1
  • 1
  • That error occured when there's multiple `session_start()`s, including that's auto-started. Try setting `session.auto_start = 0` in your `php.ini`. – mforsetti May 10 '20 at 10:09
  • Thanks for the reply. I've tried that. If I set "session.auto_start = 0" then I cannot login into cacti, the login page make a infinite loop – Fredegar May 11 '20 at 06:28
  • in [global.php](https://github.com/Cacti/cacti/blob/release/1.2.12/include/global.php), Cacti did `ini_set()`s first then doing `cacti_session_start()`. This ensures that Cacti won't hit this [upgrade note](https://github.com/php/php-src/blob/PHP-7.2.0/UPGRADING#L60) from PHP 7.2. Set `session.auto_start = 0`, put `//` in front of `$cacti_cookie_domain` in `/path/to/cacti/include/config.php`, and try again. – mforsetti May 11 '20 at 08:41
  • @mforsetti Great!! it works!!, no more ERROR PHP neither login loop. Thanks!! – Fredegar May 11 '20 at 15:48

0 Answers0