Cactiusers.org


It is currently Sat Jul 04, 2009 12:19 am




Post new topic Reply to topic  [ 8 posts ] 
 Plug-in 2.0 
Author Message
New User

Joined: Fri Jun 01, 2007 4:25 pm
Posts: 7
Post 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
New User

Joined: Fri Feb 22, 2008 2:48 am
Posts: 10
Post 
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
New User

Joined: Fri Jun 01, 2007 4:25 pm
Posts: 7
Post 
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
New User

Joined: Fri Feb 22, 2008 2:48 am
Posts: 10
Post 
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
New User

Joined: Fri Feb 22, 2008 2:48 am
Posts: 10
Post 
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
New User

Joined: Fri Jun 01, 2007 4:25 pm
Posts: 7
Post 
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
New User

Joined: Fri Jun 01, 2007 4:25 pm
Posts: 7
Post 
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
New User

Joined: Fri Feb 22, 2008 2:48 am
Posts: 10
Post 
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
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: