#254 Cannot redeclare _PEAR_call_destructors() (previously declared in /home/fuccom/public_html/social/extlib/PEAR.php:774) in /opt/cpanel/ea-php73/root/usr/share/pear/PEAR.php on line 834

باز‌کردن
3 سال پیش باز شده توسط get52 · 5 دیدگاه

I go to install GNU-SOCIAL (MASTER BRANCH)

This error:

Install GNU social Page notice Initializing...

Fatal error: Cannot redeclare _PEAR_call_destructors() (previously declared in /home/fuccom/public_html/social/extlib/PEAR.php:774) in /opt/cpanel/ea-php73/root/usr/share/pear/PEAR.php on line 834

I am on shared hosting cpanel, is there a way to fix

I go to install GNU-SOCIAL (MASTER BRANCH) This error: Install GNU social Page notice Initializing... Fatal error: Cannot redeclare _PEAR_call_destructors() (previously declared in /home/fuccom/public_html/social/extlib/PEAR.php:774) in /opt/cpanel/ea-php73/root/usr/share/pear/PEAR.php on line 834 I am on shared hosting cpanel, is there a way to fix

A fix would be to disable php pear extension on cpanel... We have to rename our pear to avoid this conflict.

A fix would be to disable php pear extension on cpanel... We have to rename our pear to avoid this conflict.

I am experiencing this exact issue. The suggested solution doesn't make sense to me... admittedly I'm new to web server stuff, but as I understand it, PEAR manages extensions, it is not an extension itself, and thus cannot be disabled as one via cPanel. Could someone clarify the above comment, or suggest a new approach?

I do have ssh access to my server as well, if something can be done via that route.

I am experiencing this exact issue. The suggested solution doesn't make sense to me... admittedly I'm new to web server stuff, but as I understand it, PEAR manages extensions, it is not an extension itself, and thus cannot be disabled as one via cPanel. Could someone clarify the above comment, or suggest a new approach? I do have ssh access to my server as well, if something can be done via that route.

I have also encounter the bug. I tried to comment

require_once INSTALLDIR . '/extlib/' . 'PEAR.php'; near Line 90 in [public_html]/gnu-social/lib/util/framework.php and add the cpanel's PEAR path. the result is:

// This is awful but system's PEAR always gives us issues, we've patched it
require_once '/opt/cpanel/ea-php74/root/usr/share/pear/' . 'PEAR.php';
// require_once INSTALLDIR . '/extlib/' . 'PEAR.php';
 require_once INSTALLDIR . '/extlib/' . 'PEAR/Exception.php';
global $_PEAR;
$_PEAR = new PEAR;
$_PEAR->setErrorHandling(PEAR_ERROR_CALLBACK,
'PEAR_ErrorToPEAR_Exception');

However, there are others needs to be modified.

I have also encounter the bug. I tried to comment `require_once INSTALLDIR . '/extlib/' . 'PEAR.php';` near Line 90 in `[public_html]/gnu-social/lib/util/framework.php` and add the cpanel's PEAR path. the result is: // This is awful but system's PEAR always gives us issues, we've patched it require_once '/opt/cpanel/ea-php74/root/usr/share/pear/' . 'PEAR.php'; // require_once INSTALLDIR . '/extlib/' . 'PEAR.php'; require_once INSTALLDIR . '/extlib/' . 'PEAR/Exception.php'; global $_PEAR; $_PEAR = new PEAR; $_PEAR->setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception'); However, there are others needs to be modified.

I was able to work around this. I used a cPanel, but I am sure there is a cli equivalent. I went into "Select PHP Version", where php extensions can be activated in cPanel, and from there into "options."

In there, there is a variable called PATH which points to the location of the system's PEAR.php.

I changed it to .:/PATH/TO/INSTALL/DIR/social/extlib

This points the system's php to GNU Social's patched PEAR.php file, so it is a pretty dirty way to fix it. However, it did clear the error and I was able to successfully install.

I was able to work around this. I used a cPanel, but I am sure there is a cli equivalent. I went into "Select PHP Version", where php extensions can be activated in cPanel, and from there into "options." In there, there is a variable called PATH which points to the location of the system's PEAR.php. I changed it to .:/PATH/TO/INSTALL/DIR/social/extlib This points the system's php to GNU Social's patched PEAR.php file, so it is a pretty dirty way to fix it. However, it did clear the error and I was able to successfully install.

I avoided this problem by following fix. FYI.

diff --git a/extlib/PEAR.php b/extlib/PEAR.php
index 220fa7890b..e75fa10fea 100644
--- a/extlib/PEAR.php
+++ b/extlib/PEAR.php
@@ -43,6 +43,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
     define('PEAR_OS',    'Unix'); // blatant assumption
 }
 
+set_include_path(__DIR__ . PATH_SEPARATOR . get_include_path());
+
 $GLOBALS['_PEAR_default_error_mode']     = PEAR_ERROR_RETURN;
 $GLOBALS['_PEAR_default_error_options']  = E_USER_NOTICE;
 $GLOBALS['_PEAR_destructor_object_list'] = array();
I avoided this problem by following fix. FYI. ``` diff --git a/extlib/PEAR.php b/extlib/PEAR.php index 220fa7890b..e75fa10fea 100644 --- a/extlib/PEAR.php +++ b/extlib/PEAR.php @@ -43,6 +43,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { define('PEAR_OS', 'Unix'); // blatant assumption } +set_include_path(__DIR__ . PATH_SEPARATOR . get_include_path()); + $GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; $GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; $GLOBALS['_PEAR_destructor_object_list'] = array(); ```
برای پیوستن به گفتگو، وارد شودید.
بدون نقطه عطف
بدون مسئول رسیدگی
5 مشارکت کننده
درحال بارگذاری...
لغو
ذخيره
هنوز محتوایی ایجاد نشده.