Page 1 of 3

Bug with xmlrpc plugin

Posted: Sun Mar 05, 2006 3:32 am
by electroteque
ive been complaining about this for a while, however Ive fixed a dredded bug which keeps complaining that xmlrpc_se function is already declared, my pear directory is the first in the php include config, so it was obviouslly trying to load that first

From my post

http://www.s9y.org/forums/viewtopic.php?t=4628

the error

Response:
<br />
<b>Fatal error</b>: Cannot redeclare xml_rpc_se() (previously declared in /Volumes/FIREWIRE/www/dev/weblog/plugins/serendipity_event_xmlrpc/PEAR/XML/RPC.php:249) in <b>/Volumes/FIREWIRE/www/classes/PEAR/XML/RPC.php</b> on line <b>370</b><br />

the fix

if (!function_exists('XML_RPC_se')) {
require_once dirname(__FILE__) . '/PEAR/XML/RPC.php';
}


the suggestion from garvin was incorrect

if (!class_exists('XML_RPC_se')) {
require_once dirname(__FILE__) . '/PEAR/XML/RPC.php';
}


as its obviouslly a function not class :)

Re: Bug with xmlrpc plugin

Posted: Sun Mar 05, 2006 8:52 pm
by garvinhicking
Hm, where is this code contained? In the CVS versions I can only find this codE:

Code: Select all

if (!class_exists('XML_RPC_Base')) {
    require_once dirname(__FILE__) . '/../RPC.php';
}
(From serendipity_event_xmlrpc/PEAR/XML/RPC/Server.php)

Code: Select all

                    if (!class_exists('XML_RPC_Base')) {
                        require_once dirname(__FILE__) . '/PEAR/XML/RPC.php';
                    }

                    if (!class_exists('XML_RPC_Server')) {
                        require_once dirname(__FILE__) . '/PEAR/XML/RPC/Server.php';
                    }
(From serendipity_event_xmlrpc/serendipity_event_xmlrpc.php)

Regards,
Garvin

Posted: Thu Sep 28, 2006 4:36 am
by gotchi
hello since one month I have the same problem.

I also installed the new 1.1 beta1 - cause I thought it will fix the problem. I didn't changed something on my server - but since a month or so ecto gives me this error after posting (but the entry gets postet - strange)

Code: Select all

Response:
<div>• Überprüfe <u>http://blog.gotchi.at/uploads/cacti.png</u> auf mögliche Trackbacks...</div><div>• URI enthielt keine Daten</div><div>• Überprüfe <u>http://www.wlug.org.nz/TitleSearch?s=cacti</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.debian-administration.org/articles/327</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.lm-sensors.org/</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://blog.gotchi.at/uploads/cacti_hardware_monitoring.png</u> auf mögliche Trackbacks...</div><div>• URI enthielt keine Daten</div><div>• Überprüfe <u>http://blog.gotchi.at/?serendipity%5Baction%5D=search&serendipity%5BsearchTerm%5D=cacti</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.technorati.com/tag/coding</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.technorati.com/tag/hardware</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.technorati.com/tag/howto</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.technorati.com/tag/linux</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.technorati.com/tag/open</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.technorati.com/tag/cacti</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><div>• Überprüfe <u>http://www.technorati.com/tag/software</u> auf mögliche Trackbacks...</div><div>• Trackback failed: Keine Trackback-URI gefunden.</div><hr noshade="noshade" /><br />
<b>Fatal error</b>:  Cannot redeclare xml_rpc_se() in <b>/usr/share/php/XML/RPC.php</b> on line <b>171</b><br />
blogging with ecto on the same server to a wordpress blog makes no failures.

xmlrpc is in version 1.23 and installed from the netmirror.org mirrors - I also tried to reinstall but no other effects.

can somebody help me or fix the problem?

within ecto I configured the blog as movable type rpc.

Posted: Thu Sep 28, 2006 6:09 am
by judebert
We've seen this a couple of times. It has turned out, so far, to be that something else is including the class. We've even added a check; apparently that's not working for you.

I've gone over the code as thoroughly as I can, given my sleepy state, and I can't see where xml_rpc_se is getting declared twice. The given line only creates an XML_RPC_Value, for cryin' out loud! How does that redeclare a method? And where we include the files, we always use require_once. Grumble grumble.

The only thing I can imagine right now -- and I don't like it, but if it works, at least it works -- is to open the serendipity_event_xmlrpc/PEAR/XML/RPC/Server.php and wrap the require_once of RPC.php with if (!class_exists('XML_RPC_Base')) {}.

Posted: Fri Sep 29, 2006 4:14 am
by gotchi
so - what does the problem mean for me ?

what should I do ?
why are these few lines of code not in the plugin on the mirror servers so everyone can get that update till a better solution was found?

Posted: Fri Sep 29, 2006 5:05 am
by gotchi
I found out - that if I modify an old blog entry - the error message didn't appear.

strange world ;)

ok - all back - now it happend again *grml*

strangest world :(

Posted: Fri Sep 29, 2006 4:33 pm
by judebert
Yeah, that's one reason why it's not everywhere. We haven't been able to figure out why it happens, or even how to fix it reliably. (The other is that the file in question is provided by someone else.)

Did you make the edit, but it's still causing errors?

Posted: Sat Sep 30, 2006 9:07 am
by gotchi
no I didn't edited the file till now - cause I don't wanna fix plugins by myself. why not?
there is spartacus and I think - fixes and updates should be provided by this engine.

otherwise it makes no sense to have spartacus ;)

Posted: Sat Sep 30, 2006 10:23 pm
by judebert
Completely agreed. This doesn't look like a plugin problem, though. It looks more like there's something wrong with the PEAR Server class we've been supplied, or some interaction between server settings and the PEAR services we use.

I don't know if the edit I recommended will even fix the problem; I'm debugging at this point. If you could make a backup, try the edited version, and let me know what happens, at least we'll have eliminated one possibility.

Posted: Wed Oct 11, 2006 4:56 am
by gotchi
sorry for answering that late

I saw that there where some updates of the xml rpc plugin. I installed them via spartacus - but then something weird happend.

now I have v 1.24 of the xml rpc plugin.
spartacus pointing to netmirror with xml and files shows me that there is an 1.25 but I am not able to install it.
pointing both spartacus settings zu s9y.org there is only an 1.24 version.

Posted: Wed Oct 11, 2006 10:07 pm
by judebert
That's weird. I'd wait another 24 hours to see if the server updates; if you can't install version 1.25 then, post here again and we'll look deeper.

Posted: Thu Oct 12, 2006 2:06 am
by gotchi
ok version 1.25 installed - worked today. but blogging problem already exists.

Posted: Thu Oct 12, 2006 11:18 pm
by mgroeninger
Hey, since it looks like you are having a problem with the PEAR module
included by php (based on the error message Cannot redeclare xml_rpc_se() in /usr/share/php/XML/RPC.php on line 171), have you tried setting

Code: Select all

 $serendipity['use_PEAR'] = false;
in serendipity_config.inc.php or serendipity_config_local.inc.php?

I'm kind of guessing, but I think it might work...

Posted: Mon Oct 16, 2006 3:17 am
by gotchi
I added the mentioned line to the serendipity_config_local.inc.php and tried to blog via ecto

same error:
<b>Fatal error</b>: Cannot redeclare xml_rpc_se() in <b>/usr/share/php/XML/RPC.php</b> on line <b>171</b><br />

Posted: Mon Oct 16, 2006 3:47 am
by mgroeninger
Could you maybe take a look at serendipity_config.inc.php and try to find something like this:

Code: Select all

if ($use_include) {
    @define('S9Y_PEAR',      true);
    @define('S9Y_PEAR_PATH', '');
} else {
    @define('S9Y_PEAR', false);
    @define('S9Y_PEAR_PATH', S9Y_INCLUDE_PATH . 'bundled-libs/');
}
Maybe it is worth checking what S9Y_PEAR and S9Y_PEAR_PATH are with an echo or something (after that block)?