Problems with PHP version 5.6 or later
-
Hello good day,
I’m having trouble using this plugin with PHP version 7, I browsed around the plugin support forum, and the only topic I found was about a member asking if the plugin was compatible with PHP version 7.
Apparently the plugin is compatible with version 7, however it returns the following error after configuring and performing the tests:
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): Failed to enable crypto Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to ssl://localhost:465 (Unknown error) SMTP ERROR: Failed to connect to server: (0) SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
I ran the tests with all versions available on my server and the plugin itself works with versions 5.4 and 5.5, the later versions return this error.
Apparently the problem that is happening is the SSL certificate verification as per the PHPMailer documentation:
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#php-56-certificate-verification-failure
In the documentation it explains that the correct one would be to replace the invalid, badly configured or self-signed certificate, but I have already contacted my server and I was informed that it does not have an SSL certificate for email shots, so failing that I would use The second option which is in the PHPMailer documentation, allow for insecure connections via SMTPOptions.Although it is not recommended, below is a code that can be added:
$mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) );
I would like to know if you can help me with this, where can I add this code so that you can continue to use PHP version 7?
After all it is highly recommended to use more updated versions since version 5.6 will soon become obsolete in security issues.
Thank you in advance.
Best regards,
- The topic ‘Problems with PHP version 5.6 or later’ is closed to new replies.