• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue error stream: 'PHP Fatal error: Cannor redeclare error() deprecatedlib.php (Moodle)

Marc Pol

New Pleskian
Hi,

A customer of ours tries to upgrade his moodle website from version 3.9.1 to 3.9.2-137. During the upgrade he gets the following message: error stream: 'PHP Fatal error: Cannor redeclare error() in /var/www/vhosts/exampledomain/httpdocs/lib/deprecatedlib.php on line 686

Now i opend the file deprecated lib on line 686 and says the following:


/**
* @deprecated since 2.0
*/
function error() {
throw new coding_exception('notlocalisederrormessage', 'error', $link, $message, 'error() is a removed, please call
print_error() instead of error()');
}

So, i tried to comment the deprecated function and re-run the upgrade. Still the same error. After that i enabled plesk logging to see what is going on. I did see in the log that the moodle package is being cahed. See this line:

ERR [panel] PleskUtilException: '/usr/local/psa/admin/bin/sappmng' '--run-application-script' '--script-file-name=configure' '--script-name=upgrade' '--script-language=php' '--user-name=exampleuser' '--php-cli=/opt/plesk/php/7.3/bin/php' '--php-ini=/var/www/vhosts/system/exampledomain/etc/php.ini' '--application-full-name=file:////usr/local/psa/var/apspackages/adiMLWzLe.zipa1d1241c-ccdb-5acb-be14/cache' '--' '3.9.1' '136' failed with code 255.

From there i headed to the cached package and finded the same deprecated function in: /usr/local/psa/var/apspackages/adiMLWzLe.zipa1d1241c-ccdb-5acb-be14/cache/htdocs/lib/deprecatedlib.php and removed the @deprecated since 2.0 function. After that I re-runned the upgrade. It worked! Could it be that plesk is pulling a wrong package of is something realy deprecated in the website of the customer, or do i not understand what is happening here.


moodle version: 3.9.2-137
plesk version: Plesk Obsidian 18.0.29
Centos version: CentOS Linux 7.8.2003 (Core)
 
Dear Marc Pol,
Thank You Very Much for your insight!
Several Moodle sites on our server showed blank pages in the place of regular main and login pages: enabling the debug mode revealed the same error that you have described. When we commented out these 4 lines of code everything returned to normal operation.
moodle versions: from 3.7 to 3.10.4
plesk version: Plesk Obsidian 18.0.37
Centos version: CentOS Linux 7.9.x (Core)
 
Back
Top