Applicable to:
- Plesk for Linux
Symptoms
-
After Plesk update or on a new Plesk installation on CentOS 7 minimal, the PHP mail doesn't work.
-
Unable to send an email with a PHP application, the following error is shown:
CONFIG_TEXT: Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
-
The following error might be shown in the following log files:
-
Apache log file
/var/log/httpd/error.log
:CONFIG_TEXT: sh: /usr/sbin/sendmail: Permission denied
-
In the PHP-FPM log file
/var/log/plesk-phpXX-fpm/error.log
:Note: Where XX is the PHP-FPM version selected in the domain.
CONFIG_TEXT: WARNING: [pool example.com] child 21423 said into stderr: "sh: /usr/sbin/sendmail: Permission denied"
-
-
The symlink
/etc/alternatives/mta
is as follows:# ls -l /etc/alternatives/mta
lrwxrwxrwx. 1 root root 26 Oct 23 23:07 /etc/alternatives/mta -> /usr/sbin/sendmail.postfix
Cause
This is a Plesk bug with the ID #PPP-46267 which is planned to be fixed in future Plesk updates.
Note: Subscribe to the article to get notified once a fix will become available
Resolution
As a workaround:
-
Connect to the server via SSH
- Create two symlinks:
# ln -s /etc/pam.d/smtp.postfix /etc/alternatives/mta-pam
# ln -s /etc/alternatives/mta-pam /etc/pam.d/smtp -
Unlink the file
/etc/alternatives/mta
:# unlink /etc/alternatives/mta
-
Re-create the Symlink pointing to
/usr/lib64/plesk-9.0/postfix-sendmail-wrapper
binary:# ln -s /usr/lib64/plesk-9.0/postfix-sendmail-wrapper /etc/alternatives/mta
Comments
2 comments
This did not fix my php sendmail issue.
Hello,
Check that the issue is not related to Selinux: https://support.plesk.com/hc/en-us/articles/213361389
In case of the issue exists please create a ticket for us https://support.plesk.com/hc/en-us/articles/213608509
Please sign in to leave a comment.