PHP: Unable to load dynamic library intl.so (OSX) - php

I am trying to run a CakePHP app. I've been working for a while in this app and recently I had to install a new dependency (using composer). Once I installed it this error came up and I can't run the app anymore:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.56.dylib
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so Reason: image not found in Unknown on line 0
When I open that folder I can see a different version of that library:
libicui18n.57.dylib
But the system is looking for
libicui18n.56.dylib
How can I install the 56 version of that library or upgrade the intl so it uses version 57?
Is that what I need to do?
Thanks!!

I have the same question when i upgrade node to v8.x.
After i run brew upgrade node,the icu4c was updated.
I solve the problem by under command:
brew unlink php56-intl
brew remove php56-intl
brew install php56-intl
so, i feel you should reinstall intl extension.

Related

PHP 8.1 - Mac M1 - brew - MongoDB error "symbol not found in flat namespace '_u_strFromUTF8_67'"

I'm facing this error
PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /opt/homebrew/lib/php/pecl/20210902/mongodb.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mongodb.so, 0x0009): symbol not found in flat namespace '_u_strFromUTF8_67'), /opt/homebrew/lib/php/pecl/20210902/mongodb.so.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mongodb.so.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mongodb.so.so' (no such file))) in Unknown on line 0
I'm on on Mac with Apple Silicon, php 8.1 installed with "brew tap shivammathur/php".
I'm trying to use php with mongodb, installed with "pecl install mongodb".
When I add extension=mongodb.so or extension="mongodb.so" to my php.ini, I receive this error.
I try to follow another post with a similar error, but with no different result.
"symbol not found in flat namespace '_PHP_MD5Init' " Error encountered in loading redis dynamic library
The same approach I used to install xdebug and no problem occoured.
Any help?
What I missed?
Just for info, pecl list print out:
Package Version State
mongodb 1.14.2 stable
Other things maybe can be useful:
macOs 12.6
php 8.1.11
mongodb 1.14.2
mongocli 1.27.0
Xdebug is also installed by pecl and it works, so I guess it must be something wrong with mongodb's package or something
You compiled mongodb with icu4c 67.1 as dependency and brew most likely updated it.
To fix this make sure icu4c is the latest version and compile the MongoDB
extension again.
brew update
brew upgrade icu4c
pecl install -f mongodb
Alternatively, you can remove the extension installed using pecl and use the homebrew tap I maintain.
https://github.com/shivammathur/homebrew-extensions
pecl uninstall mongodb
brew tap shivammathur/extensions
brew install shivammathur/extensins/mongodb#8.1

PHP72 MongoDB driver with Homebrew on OSX

I have a question that might point to a misunderstanding I have with Homebrew in relation to MongoDB:
I am running XAMPP (version) with PHP 7.2.1 (which I want to use) on Mac OSX 10.12.6 (Sierra). I installed MongoDB and created configuration and data storage folder. It runs fine on command line (when using mongod and mongodb by terminal).
Now, I want to install the PHP driver for PHP 7.2.1. I followed the instructions on http://php.net/manual/en/mongodb.installation.homebrew.php
and adapted them to version 7.2, therefore:
$ brew tap homebrew/homebrew-php
$ brew install php72-mongodb
this creates a php72 and a php72-mongodb folder in /usr/local/Cellar. However, my original (XAMPP based) PHP is in /Applications/XAMPP/ and the php there is in /Applications/XAMPP/etc/php.ini.
and simply adding:
extension="/usr/local/opt/php72-mongodb/mongodb.so"
won't do the trick. After adding this extension, Apache won't start any more. /Applications/XAMPP/logs/php_error.log shows the following error:
[27-Feb-2018 13:11:59 UTC] PHP Warning:
PHP Startup: Unable to load dynamic library 'mongodb.so'
(tried: /Applications/XAMPP/xamppfiles/lib/php/extensions
/no-debug-non-zts-20170718/mongodb.so
(dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/
no-debug-non-zts-20170718/mongodb.so, 9): image not found),
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-
20170718/mongodb.so.so
(dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-
non-zts-20170718/mongodb.so.so, 9): image not found)) in Unknown on
line 0
What is the correct way to include/connect the driver I just installed with my existing XAMPP installation? Do I need to tell Homebrew somehow where my XAMPP install is?
Given that I also have a php folder in my Homebrew (and my /usr/local/opt folder) indicates that I have a second PHP installation right now. Is this the way it is supposed to be?
The PHP version coming with MAMP is incomplete, you need to get the full version here.
Then, replace your local include folder, with the include folder of that downloaded version.
Go to your terminal and run ./configure, this will install full copy of your MAMP php.
Now that you have prepared the PHP directory, install the mongodb extension:
cd /Applications/MAMP/bin/php/php(your version ex: 7.2)/bin
and then run pecl to install mongodb extension
./pecl install mongodb
Now you have installed mongodb but your php should know this.
Go to php.ini file and search for ;Extension
Under this add extension=mongodb.so
Then restart your server and you are good to go, I hope this helps!

how to install php_trader php ext in windows 10 with xampp

Hey i am using xampp php 7.1
i am trying to install php_trader extension but
its showing me
Warning: PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_trader.dll
which i have downloaded this from here
https://pecl.php.net/package/trader/0.4.0/windows
How do i install correctly
rather than downloading the the extension from the website, you can install it using PEAR, in xampp it should be present in the /xampp/php/pear, using,
Now open a command line and cd into /xampp/php/
try executing either one of the below commands. this will try to install the extension into the system.
pear install trader
pear have a bug related to the .tar archives, please find a solution here

Error Installing composer with Homebrew

I have just installed Composer on my mac OSX 10.12.1 using Homebrew:
brew install homebrew/php/composer
Then when I call
brew info homebrew/php/composer
It shows this:
homebrew/php/composer: stable 1.3.0 (bottled), HEAD
Dependency Manager for PHP
http://getcomposer.org
/usr/local/Cellar/composer/1.3.0 (5 files, 1.7M) *
Poured from bottle on 2017-01-08 at 16:33:31
From: https://github.com/Homebrew/homebrew-php/blob/master/Formula/composer.rb
==> Requirements
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php71/7.1.0_11/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so' - dlopen(/usr/local/Cellar/php71/7.1.0_11/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so, 9): image not found in Unknown on line 0
Required: phpmeta ✔, phar ✔
How can this be fixed?
You have an issue with your PHP installation.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php71/7.1.0_11/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so' - dlopen(/usr/local/Cellar/php71/7.1.0_11/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so, 9): image not found in Unknown on line 0
Check MongoDB extension. Maybe you've removed it, but the config still includes it (check all files in /usr/local/etc/php/7.1/conf.d/).
I fixed it. It wasn't a composer issue, Trying to install Composer just alerted me to the problem. As you say it was a PHP configuration problem with mongodb. I fixed it by removing the mongodb extension from my PHP.ini file.

Laravel and Brew installation with PHP and PDO

I have just moved from linux to mac and am having some issues installing PHP with the right drivers for Laravel.
I ran brew install homebrew/php/php56-mysqlnd_ms
but now I keep getting this error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
phpinfo()
PHP Version => 5.6.21
Does anybody know how to fix this error? I am at a loss
You are missing mcrypt . You can try ,
brew install php54-mcrypt --without-homebrew-php
And then , in /etc/php.ini add,
extension="/usr/local/Cellar/php54-mcrypt/5.4.24/mcrypt.so"
I hope this will help , please let us know
Seems that you have to install the module mcrypt of php.
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
sudo composer update
Other thing that if you want to use mac and linux you can use Vagrant, is really nice how it works with virtualbox + vagrant you can have stack on other OS.
https://www.vagrantup.com/
And this is a nice project with vagrant for install all the the technologies you need.
https://github.com/fideloper/Vaprobash

Categories