| Author |
Message |
|
mconstant
New User
Joined: Fri Jun 01, 2007 4:25 pm Posts: 7
|
 Plug-in 2.0
I installed PIA 2.0 and when go to the login page I get a message at top that reads
Warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/cacti/lib/functions.php on line 146
Warning: Variable passed to each() is not an array or object in /var/www/cacti/lib/functions.php on line 147
I checked mysql and it looked like pa.sql imported fine. And I put
$config['url_path'] = '/cacti/'; into plugins.php.
Also to test I took out the if statement above the $config['url_path'] = '/cacti/'; line.
Is there somewhere else I should be looking to fix this message?
|
| Wed Feb 27, 2008 11:01 am |
|
 |
|
mduling
New User
Joined: Fri Feb 22, 2008 2:48 am Posts: 10
|
See my "PA 2.0 install steps" post on 2/25/08. I had the same problem and the solution was remarking out some stuff in include/plugins.php. It's all there in that post.
|
| Wed Feb 27, 2008 8:59 pm |
|
 |
|
mconstant
New User
Joined: Fri Jun 01, 2007 4:25 pm Posts: 7
|
Thanks for replying. I did comment out those lines as mentioned. Here is part of my plugin.php. Maybe I am missing something.
// if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
// $config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) -
// strlen('include/plugins.php'));
// db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
// } else {
// $config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
// }
$config['url_path']='/cacti/';
define('URL_PATH', $config['url_path']);
|
| Tue Mar 04, 2008 4:00 pm |
|
 |
|
mduling
New User
Joined: Fri Feb 22, 2008 2:48 am Posts: 10
|
I just removed the offending lines, but here is the end of my plugins.php file. I assume your cacti path is /cacti/.
/* On startup, register all plugins configured for use. */
if (isset($plugins) && is_array($plugins)) {
foreach ($plugins as $name) {
use_plugin($name);
}
}
$config['url_path'] = '/cacti/';
define('URL_PATH', $config['url_path']);
|
| Tue Mar 04, 2008 4:29 pm |
|
 |
|
mduling
New User
Joined: Fri Feb 22, 2008 2:48 am Posts: 10
|
If that doesn't work for you then I don't know. I was using Apache 2.0. Did you try logging in to Cacti before running the patch? Was the correct path /cacti/? If you still have no luck modifying plugin.php, I might wonder if you have something wrong with your cacti setup itself and you could find that out by doing a plain cacti install and checking it out before applying the patch.
|
| Tue Mar 04, 2008 4:36 pm |
|
 |
|
mconstant
New User
Joined: Fri Jun 01, 2007 4:25 pm Posts: 7
|
I did try logging into Cacti before the patch and it worked fine. I didn't actually patch Cacti using the .diff file. I did it by copying the files and now I am wondering if that caused a problem. I go to Cacti by typing in http://websiteaddress/cacti/ so I would think the URL_Path is /cacti/
|
| Wed Mar 05, 2008 10:15 am |
|
 |
|
mconstant
New User
Joined: Fri Jun 01, 2007 4:25 pm Posts: 7
|
I even just did a fresh copy of cacti. I would go to the login page and get no errors. I patched using the .diff file and the errors started happening again.
|
| Wed Mar 05, 2008 10:40 am |
|
 |
|
mduling
New User
Joined: Fri Feb 22, 2008 2:48 am Posts: 10
|
mconstant wrote: I even just did a fresh copy of cacti. I would go to the login page and get no errors. I patched using the .diff file and the errors started happening again.
Yes, then /cacti/ is the right path. If you removed those lines from plugins.php after the patch and you're still getting the errors, then I just don't know what the problem might be. Even though it won't help me help out, what platform and apache version are you running?
|
| Wed Mar 05, 2008 1:11 pm |
|
|