| Summary: | Cacti needs to be ported to PHP 7 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | David Hill <dhill> |
| Component: | cacti | Assignee: | Morten Stevens <mstevens> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 25 | CC: | dhill, fabrice, frank, gwync, mstevens, pat, pzeppegno, russ+bugzilla-redhat |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | cacti-0.8.8h-3.fc25 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-01-29 00:20:18 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
David Hill
2016-11-01 22:02:18 UTC
mysql_pconnect is also missing in fc25.
[Tue Nov 01 18:00:00.157179 2016] [:error] [pid 1042] [client 192.168.1.27:39066] PHP Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/cacti/lib/adodb/adodb.inc.php on line 866
[Tue Nov 01 18:05:00.253350 2016] [:error] [pid 1062] [client 192.168.1.27:39198] PHP Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in /usr/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php:355\nStack trace:\n#0 /usr/share/cacti/lib/adodb/adodb.inc.php(470): ADODB_mysql->_pconnect('localhost', 'cactiuser', 'cactiuser', 'cacti')\n#1 /usr/share/cacti/lib/adodb/adodb.inc.php(3624): ADOConnection->PConnect('localhost', 'cactiuser', 'cactiuser', 'cacti')\n#2 /usr/share/cacti/lib/database.php(51): ADONewConnection('mysql')\n#3 /usr/share/cacti/include/global.php(212): db_connect_real('localhost', 'cactiuser', 'cactiuser', 'cacti', 'mysql', '3306', false)\n#4 /usr/share/cacti/include/auth.php(25): include('/usr/share/cact...')\n#5 /usr/share/cacti/index.php(25): include('/usr/share/cact...')\n#6 {main}\n thrown in /usr/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 355
[Tue Nov 01 18:05:13.788668 2016] [:error] [pid 1036] [client 192.168.1.27:39204] PHP Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in /usr/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php:355\nStack trace:\n#0 /usr/share/cacti/lib/adodb/adodb.inc.php(470): ADODB_mysql->_pconnect('localhost', 'cactiuser', 'cactiuser', 'cacti')\n#1 /usr/share/cacti/lib/adodb/adodb.inc.php(3624): ADOConnection->PConnect('localhost', 'cactiuser', 'cactiuser', 'cacti')\n#2 /usr/share/cacti/lib/database.php(51): ADONewConnection('mysql')\n#3 /usr/share/cacti/include/global.php(212): db_connect_real('localhost', 'cactiuser', 'cactiuser', 'cacti', 'mysql', '3306', false)\n#4 /usr/share/cacti/include/auth.php(25): include('/usr/share/cact...')\n#5 /usr/share/cacti/index.php(25): include('/usr/share/cact...')\n#6 {main}\n thrown in /usr/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 355
You'll also need to add a dependency on cacti for "php-xml"
and change /usr/share/cacti/install/index.php so the line 66 looks like this : $extensions = array("session", "sockets", "mysqli", "xml");
and replace all " =& new " to " = new "
Cacti has been broken for a very long while. Are you going to do something about it? Fedora is not the only OS coming with PHP7 and the needed fixes are widely available on the net (I think Arch and Ubuntu both have applied fixes). Please fix it, I need cacti for monitorin my home network.. (In reply to pzeppegno from comment #3) > Cacti has been broken for a very long while. Are you going to do something > about it? Fedora is not the only OS coming with PHP7 and the needed fixes > are widely available on the net (I think Arch and Ubuntu both have applied > fixes). No. Cacti is not broken. It's working fine with Fedora 24 and we have the latest upstream release (0.8.8h) in our repos. > Please fix it, I need cacti for monitorin my home network.. Please report it upstream. We will always stay with the latest upstream release. An interim solution for Fedora is: 1) Stay with Fedora 24 (PHP 5.6) 2) Downgrade to PHP 5.6 It just seems a bit weird to ship it broken in 25 and not comment about your position it until now.. (In reply to pzeppegno from comment #5) > It just seems a bit weird to ship it broken in 25 and not comment about your > position it until now.. Sure, we need to wait for a new cacti release. You can be sure that we will update to the latest release as soon as possible. But it depends on the upstream project to release a new version with PHP7 compatibility. I wrote the steps to make it work with php7... just fix it on your side until we get an official RPM of that. Two additional items for this, actual patches for this are available for ArchLinux at https://bugs.archlinux.org/task/48325 and https://bugs.archlinux.org/task/49039 (although watch the DB update which may be to pdo_mysql, not mysqli). Secondly, if you already have a working configuration you need to change the variable in /etc/cacti/db.php for $database_type to "mysqli". Also, additionally, there are likely to be other errors in various plugins, but that isn't an issue with the core installation. All right. It looks like that it takes even longer for upstream to release a new cacti version with PHP7 compatibility. Therefore, I have backported the patches available from ArchLinux. Please note: This doesn't add full PHP7 compatibility. But the basic functionality of cacti should work now. Here is my commit for Fedora 25: https://src.fedoraproject.org/cgit/rpms/cacti.git/commit/?h=f25&id=c793bfa67944ede77a3796b1f275fa193eaaec40 Please let me know if you have any objections. RPM packages: https://koji.fedoraproject.org/koji/buildinfo?buildID=834677 cacti-0.8.8h-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-01a21b5785 Great, now working for me, as soon as I changed $database_type = "mysqli"; /etc/cacti/db.php (this was correct in /etc/cacti/db.php.rpmnew). Thanks! cacti-0.8.8h-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-01a21b5785 Pulled from the testing repo and it started working immediately. +1 cacti-0.8.8h-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. |