Plugins show header as file contents..?

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
parkynz
Posts: 6
Joined: Thu May 03, 2007 12:06 am

Plugins show header as file contents..?

Post by parkynz »

Plugin Arc 1.1 installed correctly and config.php edited for tools plugin and $config['url_path'] = '/cacti/';

but the header shows up as the file contents... any suggestions?

Thanks.
~Andy.
Attachments
Problem.jpg
Problem.jpg (94.29 KiB) Viewed 4166 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Plugins show header as file contents..?

Post by Howie »

parkynz wrote:Plugin Arc 1.1 installed correctly and config.php edited for tools plugin and $config['url_path'] = '/cacti/';

but the header shows up as the file contents... any suggestions?

Thanks.
~Andy.
That's the top part of setup.php... is there somehow an extra '?>' or a missing '<?' or '<?php' somewhere where there shouldn't be (near the top of setup.php)?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
parkynz
Posts: 6
Joined: Thu May 03, 2007 12:06 am

Re: Plugins show header as file contents..?

Post by parkynz »

Howie wrote:
parkynz wrote:Plugin Arc 1.1 installed correctly and config.php edited for tools plugin and $config['url_path'] = '/cacti/';

but the header shows up as the file contents... any suggestions?

Thanks.
~Andy.
That's the top part of setup.php... is there somehow an extra '?>' or a missing '<?' or '<?php' somewhere where there shouldn't be (near the top of setup.php)?
I'll check but it does the same for any other plugin so I would suspect something wrong in one of the main Cacti files... thanks.
parkynz
Posts: 6
Joined: Thu May 03, 2007 12:06 am

View Source from IE...

Post by parkynz »

I have checked all the added Plugin Arc 1.1 files for syntax in a script editor and they appear fine to me. I didn't use the patch but instead copied the files after using a program called Notepad2 (http://www.flos-freeware.ch/notepad2.html) to change the line endings from Unix (LF) to Windows (CR+LF) in all the plugin files which I know screams "There's the most likely culprit buddy!" but it all looks fine..?

I have attached the output from the View Source command in IE to show what the main login page in comprised of when the problem occurs, basically the plugin (happens for all plugins regardless) gets it's Setup.php contents whacked in on top.

My setup is:
Win2k3 SP1
IIS 6
PHP 5.2.1 (with the manual fix in cmd.php)
Cacti 0.8.6j with Plugin Arc 1.1 for 0.8.6j

Cacti works fine otherwise.

Any thoughts please?
~A.
Attachments
ViewSourceIE.txt
(2.99 KiB) Downloaded 269 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: View Source from IE...

Post by Howie »

parkynz wrote:I have checked all the added Plugin Arc 1.1 files for syntax in a script editor and they appear fine to me. I didn't use the patch but instead copied the files after using a program called Notepad2 (http://www.flos-freeware.ch/notepad2.html) to change the line endings from Unix (LF) to Windows (CR+LF) in all the plugin files which I know screams "There's the most likely culprit buddy!" but it all looks fine..?

I have attached the output from the View Source command in IE to show what the main login page in comprised of when the problem occurs, basically the plugin (happens for all plugins regardless) gets it's Setup.php contents whacked in on top.

My setup is:
Win2k3 SP1
IIS 6
PHP 5.2.1 (with the manual fix in cmd.php)
Cacti 0.8.6j with Plugin Arc 1.1 for 0.8.6j

Cacti works fine otherwise.

Any thoughts please?
~A.
Check that the files end in a CR-LF, too. I believe this can cause strange problems in PHP, otherwise. See (for example) the PEAR coding standards: [ur]http://pear.php.net/manual/en/standards.file.php[/url]
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Edit your include/config, and REM out the line

//$plugins[] = 'tools';

This will probably resolve the error that you see (although it disables the plugin also). Do you have RRDCleaner installed ? Have a look at the below URL, as this is also known to prodiuce problems. This particular issue was fixed in this post.

http://forums.cacti.net/viewtopic.php?p ... ght=#73430

I have also included my copy of the tools plugin (works fine on my system).

Hope this is of some use.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
parkynz
Posts: 6
Joined: Thu May 03, 2007 12:06 am

Fixed!

Post by parkynz »

Seems my syntax checking was bad - the very first line in each plugin setup.php file started with <? rather than <?php. Added the php bit and everything is fine. This prob is there by default in the downloaded packages - maybe someone should tend to that..?

Thanks for your help guys!
:D
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest