Nginx – Enabling openssl With PHP/nginx

nginxopensslphp5smtp

I'm getting the following error when trying to connect to SMTP + SSL through PHP using nginx + PHP 5,

Could not connect to smtp host 'ssl://smtp.gmail.com' (5) (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)

In phpinfo I see:

OpenSSL support     disabled (install ext/openssl) 

This leads me to believe I've installed OpenSSL incorrectly.

I've read a bunch of places where I should uncomment the following line:

extension = php_openssl.dll

This line does not exist so I added it to the end of my php.ini to no avail. The php_openssl.dll file does not exist anywhere on my server.

Best Answer

The line you are mentioning indeed does activate the openssl PHP-Extension on Windows Machines - though i doubt you are running nginx on Windows.

extension=openssl.so loads the openssl extension on my Box, you need to have PHP compiled with openssl Support:

--with-openssl[=DIR]

or/and advise the Package Management of your Distro to build the Extension at all/correctly.

Related Topic