Azurel
Silver Pleskian
- Server operating system version
- AlmaLinux 8.6
- Plesk version and microupdate number
- 18.0.44 Update #1
Since version 18.0.43 and possibly the ones before, I don't receive mails from PHP scripts called from the command-line anymore. I can call the same script from the browser and it works there. Has anything changed here, so that the PHP function mail() does not work anymore in command-line? There is no error. The return value of the function is TRUE in command-line and browser.
That had always worked in command-line so far. I can at least say that PHP 7.4 had worked and maybe not since the change to PHP 8.1 few weeks ago? This is a speculation, because I can not pinpoint the exact time since it no longer works. I no longer have PHP 7.4 on the server. Can anybody test it with PHP 8.1 and 7.4 on his server?
Replace "example.com" and mail-addy to one of yours.
# /opt/plesk/php/8.1/bin/php /var/www/vhosts/example.com/httpdocs/testmail.php
Does anyone have an idea or explanation for this?
That had always worked in command-line so far. I can at least say that PHP 7.4 had worked and maybe not since the change to PHP 8.1 few weeks ago? This is a speculation, because I can not pinpoint the exact time since it no longer works. I no longer have PHP 7.4 on the server. Can anybody test it with PHP 8.1 and 7.4 on his server?
Replace "example.com" and mail-addy to one of yours.
# /opt/plesk/php/8.1/bin/php /var/www/vhosts/example.com/httpdocs/testmail.php
PHP:
<?php
$return = mail('[email protected]', 'TESTMAIL', 'TEXT');
var_dump($return);
?>
Does anyone have an idea or explanation for this?