Page 2 of 2

Posted: Thu Jan 11, 2007 10:05 am
by garvinhicking
Hi!

Your output must read like this to work:

include_path .:/usr/share/php (local and master value)
open_basedir .:/home/www/webxxx:/usr/share/php (local value, master = no value)

The dot and colon at the beginning are okay, they indicate "current directory".

Best regards,
Garvin

Posted: Fri Jan 12, 2007 12:14 am
by mike
:D :D :D That's it! Thank you very much! :D :D :D

Posted: Mon Feb 26, 2007 9:03 pm
by matsch
Hi,

unfortunately I am experiencing exactly the same problem.
garvinhicking wrote:Edit your serendipity_config_local.inc.php file (check the FAQ about 'fixperm' if you have no write access to that file) and insert:

Code: Select all

$serendipity['use_PEAR'] = false;
This will instruct s9y to NOT use the advocated PEAR libraries on the server, but the ones provider with serendipity.
Also for me, this does not solve the issue - or do I have to do anything to make this config-change into effect? (when is it read?)
My provider can in the short term not install PEAR modules for me, but I don't know about setting the include_path is allowed or not.

Other parts of s9y using PEAR seem to be working. Is there no connection between those cases?

How can I resolve this issue?

Thanks!
matsch

P.S.: Following is my output of the error just for completeness.

I recently updated to Serendipity 1.1.1 und PHP 4.3.10-18. Before I did not have this issue.

Code: Select all

Warning: event_hook(): open_basedir restriction in effect. File(/usr/share/php/XML/RPC.php) is not 
within the allowed path(s): (/home/chroot/home) in 
/home/chroot/home/matsch/public_html/blog/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php 
on line 150

Warning: event_hook(XML/RPC.php): failed to open stream: Operation not permitted in 
/home/chroot/home/matsch/public_html/blog/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php 
on line 150

Warning: event_hook(): Failed opening 'XML/RPC.php' for inclusion 
(include_path='.:/usr/share/php:/usr/share/pear:/home/chroot/home/matsch/public_html/blog/bundled-libs/:/home/chroot/home/matsch/public_html/blog/bundled-libs/Smart
y/libs/:/home/chroot/home/matsch/public_html/blog/:') 
in 
/home/chroot/home/matsch/public_html/blog/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php 
on line 150
Sende XML-RPC ping zu rpc.pingomatic.com...
Fatal error: Cannot instantiate non-existent class: xml_rpc_value in 
/home/chroot/home/matsch/public_html/blog/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php 
on line 172

Posted: Tue Feb 27, 2007 11:13 am
by garvinhicking
Hi matsch!

Please talk to your provider about making the settings that have been discussed in this thread (include_path vs. open_basedir path) - his current setting seems to cause the trouble that PEAR is advocated on your server, but not usable.

If after setting use_PEAR=false the problem does not go away, as you've mentioned, this is because setting the include_path is forbidden by your provider. In that case, s9ys options are ineffectively, because they require include_path to be setable (because your provider set it wrong).

Best regards,
Garvin

Posted: Tue Feb 27, 2007 5:43 pm
by matsch
Hi,
garvinhicking wrote:Hi matsch!

Please talk to your provider about making the settings that have been discussed in this thread (include_path vs. open_basedir path) - his current setting seems to cause the trouble that PEAR is advocated on your server, but not usable.

If after setting use_PEAR=false the problem does not go away, as you've mentioned, this is because setting the include_path is forbidden by your provider. In that case, s9ys options are ineffectively, because they require include_path to be setable (because your provider set it wrong).

Best regards,
Garvin
Yes I understood what you said (I think). But there are two points I am making.
  • 1. The following little script gives me a local include path of ".:/" in the phpinfo. You can't change the master value with set_include_path(), can you?

Code: Select all

<?php
set_include_path('.:/');
phpinfo();
?>
  • 2. Other PEAR functions seem to be working (e.g. serendipity_event_spartacus, serendipity_event_backendrss, serendipity_plugin_zooomr). Only serendipity_event_weblogping doesn't. Or am I getting something wrong? What's the difference?
I think I don't fully understand the issue yet....

Regards,
matsch

Posted: Wed Feb 28, 2007 8:56 am
by garvinhicking
Hi matsch!

If you don't use set_include_path, what does the phpinfo() show you then?

Inside the serendipity_config.inc.php file you should see the methods where set_include_path is being used, if you want to trace that?

About why the weblogping plugin only emits an error: It might be that only the PEAR XML_RPC class is installed globally, and PEAR classes that other plugins use (like File_Request) are not installed globally, so there's no clash?

Best regards,
Garvin

Posted: Wed Feb 28, 2007 9:49 am
by matsch
Hi Garvin,
garvinhicking wrote:Inside the serendipity_config.inc.php file you should see the methods where set_include_path is being used, if you want to trace that?
I think something is wrong with the logic of this part in serendipity_config.inc.php:

Code: Select all

$new_include = ($serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '')
             . S9Y_INCLUDE_PATH . 'bundled-libs/' . PATH_SEPARATOR
             . S9Y_INCLUDE_PATH . 'bundled-libs/Smarty/libs/' . PATH_SEPARATOR
             . $serendipity['serendipityPath'] . PATH_SEPARATOR 
             . (!$serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '');
No matter what I set $serendipity['use_PEAR'] to, the s9y-include_path will always be appended to the end while I can force it by hand anywhere. You should check that. Seems like a bug to me...

Regards,
matsch

Posted: Wed Feb 28, 2007 12:27 pm
by garvinhicking
Hi matsch!

Code: Select all

$new_include = ($serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '')
             . S9Y_INCLUDE_PATH . 'bundled-libs/' . PATH_SEPARATOR
             . S9Y_INCLUDE_PATH . 'bundled-libs/Smarty/libs/' . PATH_SEPARATOR
             . $serendipity['serendipityPath'] . PATH_SEPARATOR 
             . (!$serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '');
No matter what I set $serendipity['use_PEAR'] to, the s9y-include_path will always be appended to the end while I can force it by hand anywhere. You should check that. Seems like a bug to me...
That's by preference. The s9y includepath to bundled-libs must always be present to allow inclusion of PEAR libraries that are not installed globally.

If PEAR is enabled, s9y puts his own directories AFTER the server-side configured, thus putting a preference on the global installation. If use_PEAR is disabled, s9y puts his own directories as the first path, thus putting a preference to the local bundled-libs directory.

Since the include_path setting is evaluated from first to last, the first hit in the include_path will be used to include a library. The use_PEAR setting will only have effect it set_include_path or ini_set('include_path') properly work. Else, if those function calls return 'false', s9y defines a CONSTANT S9Y_IUNCLUDE_PATH that hard points to the bundled-libs directory.

HTH,
Garvin

Posted: Wed Feb 28, 2007 5:17 pm
by matsch
garvinhicking wrote:If PEAR is enabled, s9y puts his own directories AFTER the server-side configured, thus putting a preference on the global installation. If use_PEAR is disabled, s9y puts his own directories as the first path, thus putting a preference to the local bundled-libs directory.
Sorry, ich glaube wir reden aneinander vorbei. :wink:

S9y macht seinen eigenen include_path eben immer an das Ende, egal wie use_PEAR gesetzt ist. Daher funktioniert es nicht.

Ich habe es bei mir getestet, wie der include_path danach gesetzt ist. Du kannst es nochmal überprüfen. Warum das so ist verstehe ich im Moment auch nicht, da die Syntax oben eigentlich was anderes sagt. Ist aber so - bitte überprüfen!

(For English readers: I just repeated what I said before - hopefully more clear now.)

Best regards,
matsch

Posted: Wed Feb 28, 2007 5:24 pm
by matsch
Hi,

to make it even more clear.

1. The result of get_include_path() with $serendipity['use_PEAR'] = false;

Code: Select all

.:/usr/share/php:/usr/share/pear:/home/chroot/home/matsch/public_html/blog/bundled-libs/:/home/chroot/home/matsch/public_html/blog/bundled-libs/Smarty/libs/:/home/chroot/home/matsch/public_html/blog/:
2. The result of get_include_path() with $serendipity['use_PEAR'] = true;

Code: Select all

.:/usr/share/php:/usr/share/pear:/home/chroot/home/matsch/public_html/blog/bundled-libs/:/home/chroot/home/matsch/public_html/blog/bundled-libs/Smarty/libs/:/home/chroot/home/matsch/public_html/blog/:
HTH,
matsch

Posted: Wed Feb 28, 2007 5:26 pm
by garvinhicking
Hi!
S9y macht seinen eigenen include_path eben immer an das Ende, egal wie use_PEAR gesetzt ist. Daher funktioniert es nicht.
Das kann aber nicht sein. Der Code sagt ja:

Setze $new_include auf folgenden Wert: Falls use_PEAR aktiviert ist, packe den jetzigen include_path an den Anfang. Wenn use_PEAR nicht aktiviert ist, packe den alten include_path nicht an den Anfang. Jetzt kommen die s9y Pfade. Und am Ende prüfst Du, ob use_PEAR nicht aktiv ist, damit der alte include_pfad angehangen wird.

Seien wir mal konkret, gehen wir von folgenden Werten aus:

Code: Select all

$old_include = '.:/usr/share/php';
$serendipity['use_PEAR'] = true;
S9Y_INCLUDE_PATH = '/www/serendipity';
Dann würde $new_include so aussehen:

Code: Select all

$new_include = '.:/usr/share/php:/www/serendipity/bundled-libs/:/www/serendipity/bundled-libs/Smarty/libs/:/www/serendipity/:';
Wenn wir aber von diesen Werten ausgehen:

Code: Select all

$old_include = '.:/usr/share/php';
$serendipity['use_PEAR'] = false; // NOT 'false'!!!!!
S9Y_INCLUDE_PATH = '/www/serendipity';
Dann würde $new_include so aussehen:

Code: Select all

$new_include = '/www/serendipity/bundled-libs/:/www/serendipity/bundled-libs/Smarty/libs/:/www/serendipity/:.:/usr/share/php:';
Lass Dir also mal $new_include ausgeben, das müsste eine korrekte Pfadsyntax aufweisen. Die einzige Möglichkeit die ich das sehe ist wenn du

Code: Select all

$serendipity['use_PEAR'] = 'false';
gesetzt hättest, denn wenn man das mit !$serendipity['use_PEAR'] vergleicht evaluiert es zu true. Oder wenn Du $serendipity['use_PEAR'] an einer anderen Stelle als in der serendipity_config.inc.php gesetzt hast und er irgendwo immer überschrieben wird.

Ansonsten, für eine Änderung die in Serendipity 1.2 drin ist, die Dir eventuell helfen könnte: http://board.s9y.org/viewtopic.php?t=9067

Grüße,
Garvin

Posted: Wed Feb 28, 2007 5:54 pm
by matsch
I found the bug! (Yes, there is one...). :twisted:

In serendipity_config.inc.php on Line 82 you check whether the Var is set:

Code: Select all

if (!isset($serendipity['use_PEAR'])) {
    $serendipity['use_PEAR'] = true;
}
But only on line 230 you include the actual config file serendipity_config_local.inc.php:

Code: Select all

include($local_config);
Thus, $serendipity['use_PEAR'] = true; will always be set to true and this statement will always have the same outcome.

Code: Select all

$new_include = ($serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '')
             . S9Y_INCLUDE_PATH . 'bundled-libs/' . PATH_SEPARATOR
             . S9Y_INCLUDE_PATH . 'bundled-libs/Smarty/libs/' . PATH_SEPARATOR
             . $serendipity['serendipityPath'] . PATH_SEPARATOR
             . (!$serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '');
HTH,
matsch

Posted: Wed Feb 28, 2007 5:58 pm
by garvinhicking
Hi!

Ah, that's good. I didn't notice I suggested to edit the _local file. I even knew about that this file was not read before the option was checked, so usually when I recommend to toggle use_PEAR I refer to the config.inc.php file.

I'm afraid the current logic doesn't allow to include the local config file earlier as it might have a possible impact on the rest of the workflow of that file, but I agree that this setting should be set within the local file, not the global one.

However, you could use that 'feature' of later inclusion to set the include_path again in the _local fine :)

Best regards,
Garvin

Posted: Wed Feb 28, 2007 6:06 pm
by matsch
Oh I am sorry.

I didn't see I should put it in the other config. I automatically assumed it was to put in the config_local. :roll:

Never mind then! :-)
matsch