[BlueOnyx:24877] Re: PHPMailer error using php 8.0.1

Michael Stauber mstauber at blueonyx.it
Mon Mar 29 14:43:34 -05 2021


Hi Robert,

> I am running WordPress 5.7 on a BO 5209R using FPM/FastCGI and get error
> "Call to undefined function PHPMailer" when using the PHP 8.0.1 package
> from the BO store. Using 7.4.x works fine.

I just checked what Pear modules the PHP-7.4 and PHP-8.0 have installed:

[root at 5209r bin]# /home/solarspeed/php-7.4/bin/pear list
Installed packages, channel pear.php.net:


=========================================


Package          Version State
Archive_Tar      1.4.9   stable
Console_Getopt   1.4.3   stable
Mail_Mime        1.10.10 stable
Net_IDNA2        0.1.1   beta
Net_Sieve        1.4.4   stable
Net_Socket       1.2.2   stable
PEAR             1.10.12 stable
Structures_Graph 1.1.1   stable
XML_Util         1.4.5   stable


[root at 5209r bin]# /home/solarspeed/php-8.0/bin/pear list
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.4.9   stable
Console_Getopt   1.4.3   stable
Mail_Mime        1.10.10 stable
Net_IDNA2        0.1.1   beta
Net_Sieve        1.4.4   stable
Net_Socket       1.2.2   stable
PEAR             1.10.12 stable
Structures_Graph 1.1.1   stable
XML_Util         1.4.5   stable

This looks pretty much the same, so this isn't the problem.

> AH01071: Got error 'PHP message: PHP Fatal error:
> Uncaught Error: Call to undefined function
> PHPMailer\\PHPMailer\\escapeshellcmd() in
> /home/.sites/70/site4/web/wp-includes/PHPMailer/PHPMailer.php:1779\n

I checked Wordpress 5.7 and examined line 1779 in the included
/web/wp-includes/PHPMailer/PHPMailer.php. And it's nothing special, really.

The just run PHP's function escapeshellcmd() on a string. I then did
some testing and created a minimalistic test script:

<? print_r(escapeshellcmd("ls -als")); ?>

That should simply print "ls -als" on execution, provided
escapeshellcmd() is available and works.

I then tried it on a Vsite with PHP-FPM 8.0.3 and it threw the same
error: "Uncaught Error: Call to undefined function escapeshellcmd()"

I then switched the Vsite from PHP-FPM (8.0.3) to suPHP (8.0.3) and it
worked.

I checked the PHP configuration of that Vsite and so far nothing really
sticks out that could explain it. But there sure is something wrong with
PHP-FPM and escapeshellcmd().

I'll need more time to figure this out. In the meantime, please use
PHP-7.4 or switch to suPHP. Sorry.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list