PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu - php

I get the error message in the question's title, or to be exact I get this message
PHP Startup: Unable to load dynamic library 'openssl'
(tried: /usr/lib/php/20170718/openssl (/usr/lib/php/20170718/openssl:
cannot open shared object file: No such file or directory),
/usr/lib/php/20170718/openssl.so (/usr/lib/php/20170718/openssl.so: cannot
open shared object file: No such file or directory)) in Unknown
My real issue with this is that it only occurs sometimes and not always. In one second a request works and in the other, I get a 500 internal error with this message on the same request.
This started to occur after I enabled the apache proxy and proxy_wstunnel mods but could also have been an apt-get upgrade or apt-get update.
From phpinfo();:
Version: PHP Version 7.2.4-1+ubuntu16.04.1+deb.sury.org+1
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.1.0h 27 Mar 2018
OpenSSL Header Version OpenSSL 1.1.0h 27 Mar 2018
Openssl default config /usr/lib/ssl/openssl.cnf
If you need futher information feel free to task.
Edit:
From apache error.log
PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: /usr/lib/php/20170718/openssl (/usr/lib/php/20170718/openssl: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/openssl.so (/usr/lib/php/20170718/openssl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Fri Apr 20 06:25:01.973125 2018] [mpm_prefork:notice] [pid 2872] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 06:25:01.973154 2018] [core:notice] [pid 2872] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 06:34:04.715749 2018] [php7:error] [pid 3490] [client 5.146.199.236:41654] PHP Fatal error: Uncaught yii\web\HeadersAlreadySentException: Headers already sent in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 414. in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php:366\nStack trace:\n#0 /var/www/html_back/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()\n#1 /var/www/html_back/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()\n#2 /var/www/html_back/vendor/yiisoft/yii2/base/ErrorHandler.php(262): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException))\n#3 [internal function]: yii\base\ErrorHandler->handleFatalError()\n#4 {main}\n thrown in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 366
[Fri Apr 20 06:34:58.208208 2018] [php7:error] [pid 3486] [client 5.146.199.236:41681] PHP Fatal error: Uncaught yii\web\HeadersAlreadySentException: Headers already sent in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 414. in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php:366\nStack trace:\n#0 /var/www/html_back/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()\n#1 /var/www/html_back/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()\n#2 /var/www/html_back/vendor/yiisoft/yii2/base/ErrorHandler.php(262): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException))\n#3 [internal function]: yii\base\ErrorHandler->handleFatalError()\n#4 {main}\n thrown in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 366

I had the same problem.
It seems like i created it by manually enable
extension=openssl
in the php.ini. After disable it again everything looked fine
php -i | grep -i openssl
SSL Version => OpenSSL/1.1.0g
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.0g 2 Nov 2017
OpenSSL Header Version => OpenSSL 1.1.0g 2 Nov 2017
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native OpenSSL support => enabled

Related

unable to run C:\composer\composer.phar create-project symfony/skeleton [duplicate]

I get the error message in the question's title, or to be exact I get this message
PHP Startup: Unable to load dynamic library 'openssl'
(tried: /usr/lib/php/20170718/openssl (/usr/lib/php/20170718/openssl:
cannot open shared object file: No such file or directory),
/usr/lib/php/20170718/openssl.so (/usr/lib/php/20170718/openssl.so: cannot
open shared object file: No such file or directory)) in Unknown
My real issue with this is that it only occurs sometimes and not always. In one second a request works and in the other, I get a 500 internal error with this message on the same request.
This started to occur after I enabled the apache proxy and proxy_wstunnel mods but could also have been an apt-get upgrade or apt-get update.
From phpinfo();:
Version: PHP Version 7.2.4-1+ubuntu16.04.1+deb.sury.org+1
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.1.0h 27 Mar 2018
OpenSSL Header Version OpenSSL 1.1.0h 27 Mar 2018
Openssl default config /usr/lib/ssl/openssl.cnf
If you need futher information feel free to task.
Edit:
From apache error.log
PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: /usr/lib/php/20170718/openssl (/usr/lib/php/20170718/openssl: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/openssl.so (/usr/lib/php/20170718/openssl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Fri Apr 20 06:25:01.973125 2018] [mpm_prefork:notice] [pid 2872] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 06:25:01.973154 2018] [core:notice] [pid 2872] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 06:34:04.715749 2018] [php7:error] [pid 3490] [client 5.146.199.236:41654] PHP Fatal error: Uncaught yii\web\HeadersAlreadySentException: Headers already sent in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 414. in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php:366\nStack trace:\n#0 /var/www/html_back/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()\n#1 /var/www/html_back/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()\n#2 /var/www/html_back/vendor/yiisoft/yii2/base/ErrorHandler.php(262): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException))\n#3 [internal function]: yii\base\ErrorHandler->handleFatalError()\n#4 {main}\n thrown in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 366
[Fri Apr 20 06:34:58.208208 2018] [php7:error] [pid 3486] [client 5.146.199.236:41681] PHP Fatal error: Uncaught yii\web\HeadersAlreadySentException: Headers already sent in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 414. in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php:366\nStack trace:\n#0 /var/www/html_back/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()\n#1 /var/www/html_back/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()\n#2 /var/www/html_back/vendor/yiisoft/yii2/base/ErrorHandler.php(262): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException))\n#3 [internal function]: yii\base\ErrorHandler->handleFatalError()\n#4 {main}\n thrown in /var/www/html_back/vendor/yiisoft/yii2/web/Response.php on line 366
I had the same problem.
It seems like i created it by manually enable
extension=openssl
in the php.ini. After disable it again everything looked fine
php -i | grep -i openssl
SSL Version => OpenSSL/1.1.0g
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.0g 2 Nov 2017
OpenSSL Header Version => OpenSSL 1.1.0g 2 Nov 2017
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native OpenSSL support => enabled

Enable imap for PHP 7.4.14 - BIG SUR

i am trying to enable my local development environment, and i have the Apache, PHP and MariaDB already installed in my Big Sur Mac. (all installed with brew)
But the imap php extension does not work and that's because the PHP is not loading the extension.
The Apache error_log throws:
PHP Warning: PHP Startup: Unable to load dynamic library 'imap'
(tried: /usr/local/lib/php/pecl/20190902/imap (dlopen(/usr/local/lib/php/pecl/20190902/imap,
9): image not found), /usr/local/lib/php/pecl/20190902/imap.so
(dlopen(/usr/local/lib/php/pecl/20190902/imap.so, 9): image not found)) in Unknown on line 0
[Sun Jan 17 09:30:08.936003 2021] [mpm_prefork:notice] [pid 2187] AH00163: Apache/2.4.46
(Unix) PHP/7.4.14 configured -- resuming normal operations
[Sun Jan 17 09:30:08.936124 2021] [core:notice] [pid 2187] AH00094: Command line:
'/usr/local/opt/httpd/bin/httpd -D FOREGROUND'
brew list command throws:
imap-uw, php#7.4, ........
Thanks in advance guys
MacOS BigSur 11.1
The extension is right here (with instructions):
shivammathur Homebrew Extensions

Unable to load dynamic library php_sqlsrv on easyphp

I'm trying to install the SQL server extension for PHP, but the extension is not visible in phpinfo().
I'm on windows 10 with easyPHP,
I installed ODBC Driver 13 for SQL Server.
My error log of apache
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Program Files (x86)\\EasyPHP-Devserver-17\\eds-binaries\\php\\php713vc14x86x170919113050\\ext\\php_sqlsrv_71_nts_x86.dll' - Le module sp\xef\xbf\xbdcifi\xef\xbf\xbd est introuvable.\r\n in Unknown on line 0
[Mon Nov 06 11:47:53.108947 2017] [mpm_winnt:notice] [pid 8260:tid 664] AH00354: Child: Starting 64 worker threads.
Thank you for your help

MongoDB driver for PHP not working

I have downloaded PHP driver for mongodb from https://pecl.php.net/package/mongodb
Then I have copied php_mongodb.dll in xampp/php/ext folder
and also added extension=php_mongodb.dll in php.ini file
But still mongodb extension in not loading, it is not showing in phpinfo().
In the PHP error log file I find this PHP Warning:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_mongodb.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0 [Wed Apr 19 11:09:54.445878 2017] [mpm_winnt:notice] [pid 2120:tid 268] AH00354: Child: Starting 150 worker threads.
Please help.
I am running windows 7 on 64 bit

Call to undefined function pg_connect()

I am running the latest version of PHP (currently 5.6.22) on OSX El Capitan and Apache server.
I am trying to use PostgreSQL database and actually, yesterday already worked but after I haver overridden httpd.conf file with a default one (I guess this is the problem) I got this message:
Call to undefined function pg_connect() in ...
The thing is that I haven't changed php.ini file. If I run phpinfo(); I get etc/php.ini for a Configuration File. So I am positive that Apache choose the right php.ini file and that correct extensions are loaded:
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
What can cause this error ? Also I have installed pgAdmin 3 and I can successfully run SQL queries on created database (which I have used yesterday for this site I am working on).
EDIT:
This is what I get in error_log file when I restart Apache server and try to run that specific page (which calls pg_connect):
[Thu Jun 02 15:28:15.595496 2016] [mpm_prefork:notice] [pid 476]
AH00169: caught SIGTERM, shutting down [Thu Jun 02 15:28:16.515774
2016] [so:warn] [pid 670] AH01574: module php5_module is already
loaded, skipping PHP Warning: PHP Startup: Unable to load dynamic
library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_curl.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_curl.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mbstring.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mbstring.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mysqli.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mysqli.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_pgsql.dll'
- dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_pgsql.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_sqlite.dll'
- dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_sqlite.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pgsql.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pgsql.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_soap.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_soap.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sockets.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sockets.dll,
9): image not found in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sqlite3.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sqlite3.dll,
9): image not found in Unknown on line 0 [Thu Jun 02 15:28:16.615703
2016] [mpm_prefork:notice] [pid 670] AH00163: Apache/2.4.18 (Unix)
PHP/5.5.31 configured -- resuming normal operations [Thu Jun 02
15:28:16.615786 2016] [core:notice] [pid 670] AH00094: Command line:
'/usr/sbin/httpd -D FOREGROUND' [Thu Jun 02 15:28:20.869683 2016]
[:error] [pid 674] [client 127.0.0.1:49594] PHP Fatal error: Call to
undefined function pg_connect() in
/Library/WebServer/Documents/site/database.php on line 10
This happens when your pgsql extension is not installed or is not compatible with your current server build (x86/x64).
Check if you have the correct file in you ext folder: php_pgsql.so (or php_pgsql.dll if youre running on windows)
Search for the line extension=php_pdo_pgsql.dll in your php.ini. Then just add it if not found or remove the comma if its commented
Run phpinfo() and check if the extension is enabled
If you found it, its good to go

Categories