|
|
| Author |
Message |
Bazou
Joined: 10 Apr 2007 Posts: 28 Location: Brussels/Belgium
|
Posted: Wed May 16, 2007 2:38 am Post subject: Suddenly a problem with editor - Javascript / DOM (solved) |
|
|
Hi all,
I'm running weathermap 0.91 and all was working perfectly until Yesterday.
Yesterday I logged off my workstation and go back at home. This morning I came at work and get the joined message when I tried to use the editor.
I made absolutely no changes to my computer, and I tried to access the editor with 4 others workstations and I get the same error as well.
when I try iy with the cli I got:
| Code: | # php editor.php
PHP Warning: Function registration failed - duplicate name - gd_info in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - imagearc in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - imageellipse in Unknown on line 0
[...same kind of error...]
PHP Warning: Function registration failed - duplicate name - imagepsencodefont in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - imagepsextendfont in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - imagepsslantfont in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - imagepstext in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - imagepsbbox in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - imagetypes in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - jpeg2wbmp in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - png2wbmp in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - image2wbmp in Unknown on line 0
PHP Warning: gd: Unable to register functions, unable to load in Unknown on line 0
<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" media="screen" href="editor.css" /> <script src="editor.js" type="text/javascript"></script><title>PHP Weathermap Editor 0.91</title></head><body><div id="nojs" class="alert"><b>WARNING</b> - Sorry, it's partly laziness on my part, but you really need JavaScript enabled and DOM support in your browser to use this editor. It's a visual tool, so accessibility is already an issue, if it is, and from a security viewpoint, you're already running my code on your <i>server</i> so either you trust it all having read it, or you're already screwed.<P>If it's a major issue for you, please feel free to complain. It's mainly laziness as I said, and there could be a fallback (not so smooth) mode for non-javascript browsers if it was seen to be worthwhile (I would take a bit of convincing, because I don't see a benefit, personally).</div><div id="withjs"><div id="dlgStart" class="dlgProperties" ><div class="dlgTitlebar">Welcome</div><div class="dlgBody">Welcome to the PHP Weathermap 0.91 editor.<p><div style="border: 3px dashed red; background: #055; padding: 5px; font-size: 97%;"><b>NOTE:</b> This editor is not finished! There are many features of Weathermap that you will be missing out on if you choose to use the editor only.These include: curves, node offsets, font definitions, colour changing, per-node/per-link settings and image uploading. You CAN use the editor without damaging these features if you added them by hand, however.</div><p>Do you want to:<p>Create A New Map:<br><form method="GET">Named: <input type="text" name="mapname" size="20"><input name="action" type="hidden" value="newmap"><input type="submit" value="Create"></form>OR<br />Open An Existing Map (looking in /var/www/cacti/plugins/weathermap/configs):<ul class="filelist"><li><a href="?mapname=example.conf">example.conf</a> - <span class="comment">Network Overview</span></li>
<li><a href="?mapname=simple.conf">simple.conf</a> - <span class="comment"></span></li>
<li><a href="?mapname=simple.conf.save">simple.conf.save</a> - <span class="comment">(no title)</span></li>
<li><a href="?mapname=test">test</a> - <span class="comment">(no title)</span></li>
<li><a href="?mapname=test.conf">test.conf</a> - <span class="comment">(no title)</span></li>
</UL></div><div class="dlgHelp" id="start_help">PHP Weathermap 0.91 Copyright © 2005-2007 Howard Jones - howie@thingy.com<br />The current version should always be <a href="http://www.network-weathermap.com/">available here</a>, along with other related software. PHP Weathermap is licensed under the GNU Public License, version 2. See COPYING for details. This distribution also includes the Overlib library by Erik Bosrup.</div></div></div></body></html> |
Note: I already get this duplicate error when it worked.
Any idea what could be the cause?
Thanks,
Gilles
| Description: |
|
| Filesize: |
42.48 KB |
| Viewed: |
1389 Time(s) |

|
Last edited by Bazou on Wed May 16, 2007 5:39 am; edited 1 time in total |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Wed May 16, 2007 3:18 am Post subject: Re: Suddenly a problem with editor - Javascript / DOM |
|
|
| Bazou wrote: |
| Code: | # php editor.php
PHP Warning: Function registration failed - duplicate name - gd_info in Unknown on line 0
|
Note: I already get this duplicate error when it worked.
Any idea what could be the cause?
|
You remember when we agreed that if it worked then it was OK? Well it doesn't, so it isn't It seems like PHP is trying to load the same extension twice.
|
|
| Back to top |
|
 |
Bazou
Joined: 10 Apr 2007 Posts: 28 Location: Brussels/Belgium
|
Posted: Wed May 16, 2007 3:34 am Post subject: |
|
|
Yeah i remember
But It worked with this. Anyway, I commented the gd extension in php.ini.
There is no more these warnings but I can't still access the editor
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Wed May 16, 2007 3:36 am Post subject: |
|
|
| Bazou wrote: | Yeah i remember
But It worked with this. Anyway, I commented the gd extension in php.ini.
There is no more these warnings but I can't still access the editor  |
If you look at check.php in the web browser, does it show that your web PHP is loading any additional config files? (this would appear just under where it tells you what PHP version you have). If it does, make sure that none of those also have the extension=gd.so in it. You need it once, and only once.
|
|
| Back to top |
|
 |
Bazou
Joined: 10 Apr 2007 Posts: 28 Location: Brussels/Belgium
|
Posted: Wed May 16, 2007 3:45 am Post subject: |
|
|
I forget to mention that check.php return YES for all tests.
The additional files are:
| Code: | The php.ini file was /etc/php4/cli/php.ini
The following additional ini files were read: /etc/php4/cli/conf.d/gd.ini,
/etc/php4/cli/conf.d/mysql.ini,
/etc/php4/cli/conf.d/snmp.ini |
The gd extension was in gd.ini.
So, now it's OK but it seems that it wasn't linked with the editor error.
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Wed May 16, 2007 3:54 am Post subject: |
|
|
| Bazou wrote: | I forget to mention that check.php return YES for all tests.
|
It would do. The functions do exist. The problem is that the error messages will get in the way of outputting the actual image data.
| Bazou wrote: |
The additional files are:
| Code: | The php.ini file was /etc/php4/cli/php.ini
The following additional ini files were read: /etc/php4/cli/conf.d/gd.ini,
/etc/php4/cli/conf.d/mysql.ini,
/etc/php4/cli/conf.d/snmp.ini |
The gd extension was in gd.ini.
So, now it's OK but it seems that it wasn't linked with the editor error. |
Your web php is reading /etc/php4/cli files? That sounds strange, but OK.
What was the actual editor error then? Don't forget that if you are running 'php editor.php' from the command line, then that isn't the same PHP that would normally run the editor.
|
|
| Back to top |
|
 |
Bazou
Joined: 10 Apr 2007 Posts: 28 Location: Brussels/Belgium
|
Posted: Wed May 16, 2007 4:13 am Post subject: |
|
|
Check.php running in apache is also alright.
The error is, when i go to the editor's URL in my browser, I can't no more access to it as it said that I need to have javascript and DOM enabled.
The fact is that they are. I didn't change any settings on my workstation since yesterday and I 'm using javascript right now (for Gmail for example :p).
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Wed May 16, 2007 4:28 am Post subject: |
|
|
| Bazou wrote: | Check.php running in apache is also alright.
The error is, when i go to the editor's URL in my browser, I can't no more access to it as it said that I need to have javascript and DOM enabled.
The fact is that they are. I didn't change any settings on my workstation since yesterday and I 'm using javascript right now (for Gmail for example :p). |
If you view source on the editor page, is there anything unusual (non-HTML-looking) at the top? The editor hasn't really changed in over a year... My guess would be that this is still related to the same problem. It sounds like maybe the same issue, but for the web php (which is why I said check for duplicates in the web check.php list of ini files).
|
|
| Back to top |
|
 |
Bazou
Joined: 10 Apr 2007 Posts: 28 Location: Brussels/Belgium
|
Posted: Wed May 16, 2007 4:52 am Post subject: |
|
|
Ok, I just understanded what you mean. Apache read gd.ini too, which was created and linked during the installation of the debian gd package. So on debian there is no need to edit php.ini for both cli and apache.
Now that's OK. But it doesn't solved the problem.
On the page's source, I got LOTS of these errors lines:
| Code: | <b>Warning</b>: feof(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>52</b><br />
<br />
<b>Warning</b>: fgets(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>54</b><br />
<br /> |
These 2 lines are repeated infinitly.
Hope it helps.
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Wed May 16, 2007 4:59 am Post subject: |
|
|
| Bazou wrote: | Ok, I just understanded what you mean.
|
Sorry - that was a little complex.
| Bazou wrote: |
On the page's source, I got LOTS of these errors lines:
| Code: | <b>Warning</b>: feof(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>52</b><br />
<br />
<b>Warning</b>: fgets(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>54</b><br />
<br /> |
These 2 lines are repeated infinitly.
|
OK - that is where the editor is reading the config files in the configs/ directory to see if they have titles. Are any files in there unreadable by the webserver?
|
|
| Back to top |
|
 |
Bazou
Joined: 10 Apr 2007 Posts: 28 Location: Brussels/Belgium
|
Posted: Wed May 16, 2007 5:07 am Post subject: |
|
|
Yes! you got it
There was a "simple.conf.save" created by root yesterday. I don't know how it appears here but the problem is now solved
thank you Howie!
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Wed May 16, 2007 5:47 am Post subject: |
|
|
| I'll try and fix this in the next release. It shouldn't really bring the whole thing crashing down like that.
|
|
| Back to top |
|
 |
|