Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

problem I have been unable to resolve for two days

Anyone know how to fix the openssl.so not found error?

PHP Warning: PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/local/lib/php/pecl/20210902/openssl.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so, 9): image not found), /usr/local/lib/php/pecl/20210902/openssl.so.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/local/lib/php/pecl/20210902/openssl.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so, 9): image not found), /usr/local/lib/php/pecl/20210902/openssl.so.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so.so, 9): image not found)) in Unknown on line 0
PHP 8.1.15 (cli) (built: Feb 2 2023 18:43:34) (NTS)
Zend Engine v4.1.15, Copyright (c) Zend Technologies
with Zend OPcache v8.1.15, Copyright (c), by Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans

summary - what i tried

after macOS update to Big Sur 11.7.3,
fixed Xcode and made sure Command Line Tools are 13.2.1 per brew doctor
Used brew doctor to fix all warnings until "ready to brew" returned
completed brew update && brew upgrade
Fixed asdf, fixed python, fixed nodejs, couldn't fix php
so
followed instructions from grav for multiple php versions

brew uninstall --ignore-dependencies openssl
brew uninstall --ignore-dependencies openssl
brew install openssl
# put openssl first in the path
brew tap shivammathur/php
brew install shivammathur/php/php@7.4
# edit php.ini, httpd.conf, and verify ~/.bashrc
# tested 
brew unlink php && brew link --overwrite --force php@7.4
brew services restart php@7.4
# check http://localhost:8080/info.php

brew install shivammathur/php/php@8.1
# edit php.ini, httpd.conf, and verify ~/.bashrc
brew unlink php && brew link --overwrite --force php@8.1
# tested by brew services restart httpd and php@8.1
# check http://localhost:8080/info.php 
# installed [PHP switcher script](https://gist.github.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2)
# check with 
sphp 7.4
sphp 8.1

Install 8.2

brew install shivammathur/php/php@8.2
brew unlink php && brew link --overwrite --force php@8.2
# edit php.imi, httpd.conf and varify .bashrc
brew services restart shivammathur/php/php
# brew services only shows php@7.4 and php@8.1 but 
# php@8.1 started      <username>  ~/Library/LaunchAgents/homebrew.mxcl.php@8.1.plist
# 
brew reinstall $(brew deps shivammathur/php/php@8.1) shivammathur/php/php@8.1
sphp 8.2
# still starting 8.1
sphp 8.1
# check info.php in localhost -seems fimne

Attempt update Xdebug

pecl uninstall -r xdebug
pecl install xdebug
  • install completes and xdebug info available in localhost:info.php
  • but still seeing errors:

PHP Warning: PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/local/lib/php/pecl/20210902/openssl.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so, 9): image not found), /usr/local/lib/php/pecl/20210902/openssl.so.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/local/lib/php/pecl/20210902/openssl.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so, 9): image not found), /usr/local/lib/php/pecl/20210902/openssl.so.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so.so, 9): image not found)) in Unknown on line 0

  • Searched all local drives for openssl.so - only found in backups from 2019 when I was using anaconda and doing some stuff in R
brew info php@8.1
  • Shows openssl@1.1 ✔,

  • Checked for extension_dir in php.ini (/usr/local/lib/php/pecl/20210902)

  • contains the three things installed by pecl - xdebug.so, imagick.so, yaml.so

php --ini

PHP Warning: PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/local/lib/php/pecl/20210902/openssl.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so, 9): image not found), /usr/local/lib/php/pecl/20210902/openssl.so.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/local/lib/php/pecl/20210902/openssl.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so, 9): image not found), /usr/local/lib/php/pecl/20210902/openssl.so.so (dlopen(/usr/local/lib/php/pecl/20210902/openssl.so.so, 9): image not found)) in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/etc/php/8.1
Loaded Configuration File: /usr/local/etc/php/8.1/php.ini
Scan for additional .ini files in: /usr/local/etc/php/8.1/conf.d
Additional .ini files parsed: /usr/local/etc/php/8.1/conf.d/ext-opcache.ini,
/usr/local/etc/php/8.1/conf.d/ext-xdebug.ini

You must be logged in to vote

@kjon-life

The file openssl.so is not there as the openssl extension is compiled statically into php.
You have an ini entry to load openssl.so, which should not be there.

Please run the following command to check this

grep -r extension.*=.*openssl $(brew --prefix)/etc/php/8.1

Then comment out any lines with extension=openssl in the ini files that are uncommented by prefixing the line with a ;.

Replies: 1 comment · 1 reply

Comment options

@kjon-life

The file openssl.so is not there as the openssl extension is compiled statically into php.
You have an ini entry to load openssl.so, which should not be there.

Please run the following command to check this

grep -r extension.*=.*openssl $(brew --prefix)/etc/php/8.1

Then comment out any lines with extension=openssl in the ini files that are uncommented by prefixing the line with a ;.

You must be logged in to vote
1 reply
@kjon-life
Comment options

thank you!!

Answer selected by kjon-life
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.