View Issue Details

IDProjectCategoryView StatusLast Update
0033418mantisbtdocumentationpublic2024-02-20 16:58
Reporterrogueresearch Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.25.8 
Target Version2.26.1Fixed in Version2.26.1 
Summary0033418: Document PHP ctype extension as required
Description

The other day I upgraded from mantis 2.25.7 to 2.25.8, then a couple of days later from php 7.4.33 to 8.1.26, the day after that, the system sent this email:

PHP Fatal error:  Uncaught Error: Call to undefined function PHPMailer\PHPMailer\ctype_alnum() in /usr/local/etc/apache24/mantis.example.com/vendor/phpmailer/phpmailer/src/PHPMailer.php:1798
Stack trace:
#0 /usr/local/etc/apache24/mantis.example.com/vendor/phpmailer/phpmailer/src/PHPMailer.php(1877): PHPMailer\PHPMailer\PHPMailer::isShellSafe()
#1 /usr/local/etc/apache24/mantis.example.com/vendor/phpmailer/phpmailer/src/PHPMailer.php(1640): PHPMailer\PHPMailer\PHPMailer->mailSend()
#2 /usr/local/etc/apache24/mantis.example.com/vendor/phpmailer/phpmailer/src/PHPMailer.php(1471): PHPMailer\PHPMailer\PHPMailer->postSend()
#3 /usr/local/etc/apache24/mantis.example.com/core/email_api.php(1416): PHPMailer\PHPMailer\PHPMailer->send()
#4 /usr/local/etc/apache24/mantis.example.com/core/email_api.php(1233): email_send()
#5 /usr/local/etc/apache24/mantis.example.com/core/email_api.php(2123): email_send_all()
#6 [internal function]: email_shutdown_function()
#7 {main}
  thrown in /usr/local/etc/apache24/mantis.example.com/vendor/phpmailer/phpmailer/src/PHPMailer.php on line 1798

I'm guessing it's due to the PHP update.

Look like mantis 2.25.8 has PHPMailer 6.5.0. I see manits 2.26 updated to PHPMailer 6.8.0 in 0029025. I suppose I'll try updating mantis to 2.26.

But this appears to mean that 2.25.8 is not fully PHP 8 compatible...

TagsNo tags attached.

Activities

dregad

dregad

2023-12-10 06:26

developer   ~0068395

Not sure it's a PHP 8 compatibility issue, as ctype_alnum() exists since PHP 4, but the function is part of ctype extension so maybe that is not installed in your PHP 8.1 system ?

rogueresearch

rogueresearch

2023-12-10 12:01

reporter   ~0068397

Last edited: 2023-12-10 12:01

Ah ha! Indeed the package manager removed php74-ctype as incompatible but neither it nor I added it back.

It's not listed as required, but I guess the EmailReporting plugin needs it.

Is there a mechanism for the plugin to tell mantisbt this, so that admin/check/index.php can report the extension as missing?

dregad

dregad

2023-12-10 12:40

developer   ~0068398

I don't know the requirements of the EmailReporting plugin (I don't use it) but there is currently no way for a plugin to tell the core about its PHP extension requirements.

That being said, I checked and ctype extension is actually required by the PHPMailer library, which is used by MantisBT email API to do its job so we should document that, and update the admin checks accordingly.

Thanks for the bug report.

rogueresearch

rogueresearch

2023-12-11 11:12

reporter   ~0068400

Changes lgtm. Many thanks!

Related Changesets

MantisBT: master-2.26 29d701e8

2023-12-10 12:52

dregad


Details Diff
ctype PHP extension is required by PHPMailer

- Reference it in the Admin Guide's installation section
- Verify its presence in Admin Checks

Fixes 0033418
Affected Issues
0033418
mod - admin/check/check_php_inc.php Diff File
mod - docbook/Admin_Guide/en-US/Installation.xml Diff File