Welcome to Geeklog, Anonymous Monday, April 22 2024 @ 02:04 am EDT

Question: Geeklog and PEAR

Answer: What is PEAR?

PEAR is a collection of PHP classes for common tasks, so that PHP scripts don't have to "reinvent the wheel".

A base collection of PEAR classes is included with every PHP install as of PHP 4.3.0. Geeklog also ships with the all the PEAR classes it needs (in system/pear) and is preconfigured to use those, so it doesn't require PEAR to be installed on the webserver.

PEAR options in Geeklog

There are two config.php options for PEAR support:

$_CONF['have_pear'] = false;
$_CONF['path_pear'] = $_CONF['path_system'] . 'pear/';

The first option, $_CONF['have_pear'], tells Geeklog whether to use the PEAR packages included with Geeklog (false) or those installed on the server (true).

$_CONF['have_pear'] = true; should be read as "I have PEAR installed on my server".

The second option, $_CONF['path_pear'], will only be used when $_CONF['have_pear'] = false and tells Geeklog where the PEAR packages are to be found.

For this to work, however, Geeklog will have to call the PHP function ini_set, which is sometimes disabled by the hosting service for alleged security reasons. If that is the case (you'll find a note to that effect in your error.log and possibly on your screen when you try to send an email from Geeklog) you will have to switch to using $_CONF['have_pear'] = true and hope that your hosting service has the proper PEAR packages installed ...


If you're getting errors like this:

Warning: com_isemail(Mail/RFC822.php): failed to open stream: No such file or directory in /path/to/geeklog/public_html/lib-common.php on line 3396

Fatal error: com_isemail(): Failed opening required 'Mail/RFC822.php' (include_path='./') in /path/to/geeklog/public_html/lib-common.php on line 3396

then this means that Geeklog could not find the required PEAR classes.

If you have $_CONF['path_pear'] = true then this indicates that PEAR is not (properly) installed on your server. Try switching for $_CONF['path_pear'] = false or contact your hosting service.

If you have $_CONF['path_pear'] = false when you get this message, then this usually means that you're not allowed to call ini_set and therefore Geeklog couldn't point PHP to where the PEAR classes are located. Check your error.log file to confirm this and try switching to $_CONF['path_pear'] = true.

So, under normal circumstances, you should be able to resolve this issue by either setting $_CONF['path_pear'] to true or false, depending on your setup.

If you can't use ini_set and PEAR is not installed on your server, then you are out of luck and should consider switching hosting services.

Note: Geeklog versions 1.3.9 through 1.3.11 used PEAR only to send email (see Configuring email). Geeklog 1.4.0 started using PEAR for other functionalty (e.g. reading RSS feeds). Future versions will most likely use even more PEAR classes for other tasks.

Hits: 184

FAQ » Installation » Geeklog and PEAR