Fatal error: Cannot redeclare class pear in /home/httpd/vhosts/jnlew.com/httpdocs/blog/bundled-libs/PEAR.php on line 86
I am getting this error when I try to fetch a plugin. This happens on both sidepanel and the function plugins as well.
I am new to linux(ubuntu) so I may need to dig around for an editor with line numbers to post the required snip of code lol...
My site is running a content-management system/shopping cart one of my colleagues wrote. I am quite certain it is loading pear classes of its own so this may have something to do with it..
Thanks,
Nigel lew
Edit: Fixed via .htaccess less coffee, more thinking
Fatal error: Cannot redeclare class pear
-
- Regular
- Posts: 36
- Joined: Sun Feb 12, 2006 9:27 pm
- Location: London
- Contact:
I thought I'd dig up another old post just for fun
While I don't have any issues with Serendipity itself running, I continue to add several bits to my Serendipity based site. I've ran into a PEAR problem.
The PEAR installation on my webhost is:
I installed a local version of PEAR, but had trouble getting some of my own code to work when I put this into the .htacces file:
So, I took this out of the bundled-libs PEAR.php:
And things seem to be OK.
I would prefer to force Serendipity and everthing else to use my own current version local install of PEAR and its libraries, but don't know exactly what to put in the .htaccess file.
Any thoughts ?
While I don't have any issues with Serendipity itself running, I continue to add several bits to my Serendipity based site. I've ran into a PEAR problem.
The PEAR installation on my webhost is:
This seems very old and the code I need to use has problems with this default PEAR, but works fine with the bundled-libs PEAR or a brand new current version.PEAR 1.3b3 beta
I installed a local version of PEAR, but had trouble getting some of my own code to work when I put this into the .htacces file:
Code: Select all
php_value include_path '/usr/www/users/myusername/mysitedir/pear/PEAR'
Code: Select all
// Serendipity-Patch
if (class_exists('PEAR')) {
return false;
}
// Serendipity-Patch end
I would prefer to force Serendipity and everthing else to use my own current version local install of PEAR and its libraries, but don't know exactly what to put in the .htaccess file.
Any thoughts ?
-
- Regular
- Posts: 36
- Joined: Sun Feb 12, 2006 9:27 pm
- Location: London
- Contact:
The system itself has PEAR, as I mentioned, an old version. But it doesn't seem to be interfering with the s9y bundled-libs PEAR. The discussion in :
http://www.s9y.org/forums/viewtopic.php ... torder=asc
indicates that the code:
was put in by Garvin to deal with when a system level PEAR is called before the bundled-libs version.
So far I have not experienced any problems after removing the above code from bundled-libs PEAR.php
However I would like to find a way (I think it is through .htaccess) for all the files in my site that call PEAR to use the new, current version that I have installed within my hosting space.
http://www.s9y.org/forums/viewtopic.php ... torder=asc
indicates that the code:
Code: Select all
// Serendipity-Patch
if (class_exists('PEAR')) {
return false;
}
// Serendipity-Patch end
So far I have not experienced any problems after removing the above code from bundled-libs PEAR.php
However I would like to find a way (I think it is through .htaccess) for all the files in my site that call PEAR to use the new, current version that I have installed within my hosting space.
I think we're in strenuous agreement, here. That code prevents Serendipity from including its own PEAR libraries when the system libraries already include PEAR.
You want to use the new PEAR libraries you downloaded yourself.
I could be mistaken, but I believe the include path is specified in the php.ini. That should affect all PHP calls. If you can change it to remove the old PEAR library path and point to yours instead, it should include your libraries instead of the old ones.
I checked Google, and found this .htaccess command, which might help:
But I don't know if that will keep that old paths, or if it'll override the paths in the system-wide PHP configuration.
EDIT: a little more searching turns up that this depends at least partly on whether PHP is being run as an Apache module or as a CGI binary. The .htaccess method only works for Apache modules.
You want to use the new PEAR libraries you downloaded yourself.
I could be mistaken, but I believe the include path is specified in the php.ini. That should affect all PHP calls. If you can change it to remove the old PEAR library path and point to yours instead, it should include your libraries instead of the old ones.
I checked Google, and found this .htaccess command, which might help:
Code: Select all
php_value include_path "newpath:other_paths:."
EDIT: a little more searching turns up that this depends at least partly on whether PHP is being run as an Apache module or as a CGI binary. The .htaccess method only works for Apache modules.