Skip to content

Ensure Cacti can support PHP 8 #4001

Description

@paulgevers

PHP8 makes Cacti spit out lots of errors and warnings (but otherwise succeeds)

In Debian Experimental, the default PHP was upgraded to PHP8 to check if its possible to upgrade PHP8 before the Debian Freeze (12 January 2021). It turns out that the testsuite I have for Cacti in the Debian package fails on PHP Errors and Warnings. This means by the way that the web pages seem to be successfully served, as the log check comes last. Although I worry especially about the CSRF errors.

To Reproduce

Recursive web crawl on a cacti site with PHP8 as the running PHP version

An example log can be found here. I'll copy/paste the first part below as that log is recycled after some time. Fresh logs are probably available here.

Expected behavior

No new Error (and ideally no new Warning) messages compared to PHP7.

Desktop

Not applicable

Smartphone

Not applicable

Additional context

Headless server running Debian unstable with php-default packages from experimental.

Unexpected output in /var/log/cacti/cacti.log:
12/12/2020 05:31:28 - ERROR PHP WARNING: ini_set(): Cannot change zlib.output_compression - headers already sent in file: /usr/share/cacti/site/lib/import.php  on line: 260
12/12/2020 05:31:28 - CMDPHP PHP ERROR WARNING Backtrace:  (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[260]:ini_set(), CactiErrorHandler())
12/12/2020 05:31:29 - ERROR PHP WARNING: ini_set(): Cannot change zlib.output_compression - headers already sent in file: /usr/share/cacti/site/lib/import.php  on line: 260
12/12/2020 05:31:29 - CMDPHP PHP ERROR WARNING Backtrace:  (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[260]:ini_set(), CactiErrorHandler())
12/12/2020 05:31:30 - ERROR PHP WARNING: ini_set(): Cannot change zlib.output_compression - headers already sent in file: /usr/share/cacti/site/lib/import.php  on line: 260
12/12/2020 05:31:30 - CMDPHP PHP ERROR WARNING Backtrace:  (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[260]:ini_set(), CactiErrorHandler())
12/12/2020 05:31:32 - ERROR PHP WARNING: ini_set(): Cannot change zlib.output_compression - headers already sent in file: /usr/share/cacti/site/lib/import.php  on line: 260
12/12/2020 05:31:32 - CMDPHP PHP ERROR WARNING Backtrace:  (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[260]:ini_set(), CactiErrorHandler())
12/12/2020 05:31:41 - ERROR PHP WARNING: fopen(/usr/share/cacti/site/include/vendor/csrf/csrf-secret.php): Failed to open stream: Permission denied in file: /usr/share/cacti/site/include/vendor/csrf/csrf-magic.php  on line: 490
12/12/2020 05:31:41 - CMDPHP PHP ERROR WARNING Backtrace:  (/index.php[25]:include(), /include/auth.php[177]:require_once(), /auth_login.php[827]:include_once(), /include/global_session.php[135]:csrf_get_tokens(), /include/vendor/csrf/csrf-magic.php[125]:csrf_get_secret(), /include/vendor/csrf/csrf-magic.php[366]:csrf_writable(), /include/vendor/csrf/csrf-magic.php[490]:fopen(), CactiErrorHandler())
12/12/2020 05:31:41 - ERROR PHP WARNING: fopen(/usr/share/cacti/site/include/vendor/csrf/csrf-secret.php): Failed to open stream: Permission denied in file: /usr/share/cacti/site/include/vendor/csrf/csrf-magic.php  on line: 490
12/12/2020 05:31:41 - CMDPHP PHP ERROR WARNING Backtrace:  (/index.php[25]:include(), /include/auth.php[177]:require_once(), /auth_login.php[827]:include_once(), /include/global_session.php[135]:csrf_get_tokens(), /include/vendor/csrf/csrf-magic.php[140]:csrf_hash(), /include/vendor/csrf/csrf-magic.php[423]:csrf_get_secret(), /include/vendor/csrf/csrf-magic.php[366]:csrf_writable(), /include/vendor/csrf/csrf-magic.php[490]:fopen(), CactiErrorHandler())

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions