Unable to load dynamic library '/usr/local/lib/php/20060613/openssl'

I am getting fatal error when calling openssl_pkey_get_private() in PHP

I've enabled openssl in php.ini and restarted the server
extension=php_openssl.dll

I've realized that the extension directory /usr/local/lib/php/20060613
has no openssl.so file

I am using FreeBSD OS and php 5.2.12

So my  question is how to enable openssl extension on my server, can I achieve it without re-compiling php. What are the implications of re-compiling  .. or can I just copy openssl.so from another server to the extension directory (where to download such file?) .. what do you suggest
phpmysqlcoderAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Phil PhillipsConnect With a Mentor Director of DevOps & Quality AssuranceCommented:
You shouldn't have to recompile PHP itself - just the ssl module.

If you're using ports, the port to (re-)install would be: security/php5-openssl
0
 
phpmysqlcoderAuthor Commented:
Not clear enough how I can recompile the SSL module by itself.
0
 
Phil PhillipsDirector of DevOps & Quality AssuranceCommented:
Just some supplemental information.

1) Uninstall php5-openssl:
pkg_delete -x php5-openssl

2) Install php5-openssl:
To install the port: cd /usr/ports/security/php5-openssl/ && make install clean
To add the package: pkg_add -r php5-openssl

The install command you use depends on whether you are using the ports tree or packages.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.