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
I recently was trying to install MongoDB for PHP, I used
brew install homebrew/php/php55-mongodb
This installed a whole load of other requirements and now intl.so for PHP is broken. I get the above error whenever I run composer update and the libs I have that need intl.so now break and say its not present.
I believe this is related to the issue but it offers no solution https://github.com/Homebrew/homebrew-php/issues/2544
How can I undo this mess?
After more digging I removed, then installed intl using pecl and this seems to have worked. I also removed and then reinstalled icu4c as this is a related package that causes the issue;
sudo pecl remove intl
brew unlink icu4c
brew remove icu4c
brew install icu4c
sudo pecl install intl
Related
I am trying to install the zip and the intl extension for PHP 7.4.10
I run
sudo pecl install intl
and then the installation is requesting :
Specify where ICU libraries and headers can be found [DEFAULT] :
then I hit enter and continues but then it shows the next error:
configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:
No package 'icu-uc' found
No package 'icu-io' found
No package 'icu-i18n' found
then I start to look how to install icu, I run:
brew install icu4c
the console shows:
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> /Users/user/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> /Users/user/.bash_profile
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
For pkg-config to find icu4c you may need to set:
export .bash_profile="/usr/local/opt/icu4c/lib/pkgconfig"
I added all the paths to the .bash_profile config file and run:
source .bash_profile
at this point I am not sure what todo I am still receiving:
== Environment ==
!! php_extension zip !!
[System] must be installed and enabled - The Zip PHP extension is now required by Moodle, info-ZIP binaries or
PclZip library are not used anymore.
!! php_extension intl !!
[System] must be installed and enabled - Intl extension is required to improve internationalization support, such as
locale aware sorting and international domain names.
even after run sudo apachectl restart
also I have check a lot of guides to install the zip extension via php.ini adding extension=zip but is not working
any help will be appreciated
[UPDATE]I tried to use the fist answer to the post and I got after run all and the last command output was sudo pecl update-channels && sudo pecl install intl
checking for icu-uc >= 50.1 icu-io icu-i18n... no
configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:
No package 'icu-uc' found
No package 'icu-io' found
No package 'icu-i18n' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables ICU_CFLAGS
and ICU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
ERROR: `/private/tmp/pear/temp/intl/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-icu-dir=/usr/local/opt/icu4c' failed
Is icu4c present on your system ? What is the output of:
which icu4c
If you have no output we can investigate further. A quick look at the ICU documentation tell us that the library relies on autoconf.
brew update
brew install autoconf automake libtool
brew install icu4c
Now let's check if icu4c is installed properly
which icu4c
If at this point you still have no output then it's better to install and compile icu4c from source.Because this library installed via Homebrew could be suffering from multiple issues.
wget https://github.com/unicode-org/icu/releases/download/release-67-1/icu4c-67_1-src.tgz
tar xvfz icu4c-67_1-src.tgz
cd icu/source
./configure --prefix=/usr/local/opt/icu4c/67_1 --enable-icu-config
sudo make && sudo make install
Afterwards you can resume
sudo pecl update-channels && sudo pecl install intl
If you will be asked
Specify where ICU libraries and headers can be found [DEFAULT] :
The answer is
/usr/local/opt/icu4c
When icu4c is installed with brew, it doesn't copy its files to pkg-config configuration directory.
So, another workaround would be to be to set the PKG_CONFIG_PATH to the folder where the lib is located. Example:
PKG_CONFIG_PATH=/usr/local/Cellar/icu4c/69.1/lib/pkgconfig/ pkg-config --cflags --libs libsoup-2.4
I'm trying to install PHP 7.4 with Homebrew on MacOS Catalina. I used the following command:
brew install php#7.4
This failed during the post install step with an error about a dyld library:
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Referenced from: /usr/local/Cellar/php/7.4.4/bin/php
Reason: image not found
I get the same error if I try to run php from the command line afterwards.
I ran brew doctor, which advised me that the gmp keg was installed but unlinked (there were actually several versions of gmp installed). I ran:
brew link gmp
which added the missing links.
I then ran:
brew reinstall php --build-from-source
which was now able to find the gmp library.
I have tried installing using pecl command but still getting the same issue. Enabled the extension in the php.ini but again of new use
Unable to load dynamic library '/usr/local/Cellar/php70-intl/7.0.27_24/intl.so'
I am trying to install CakePHP. PHP version is 7.2 and intl present on mac /usr/local/Cellar/php70-intl . Please help me with the same. I have tried almost everything.
brew install icu4c
root$: sudo pecl update-channels
root$: sudo pecl install intl
tried everything mentioned above but still of no use
I'm trying to run php app that use locale_accept_from_http function from intl extension. My php version is 7.2 and I get an error: Call to undefined function locale_accept_from_http();
I was trying:
1. Install extension sudo apt-get install php-intl.
The error is:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php-intl : Depends: php7.1-intl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
2. Enable intl extension in php.ini.
I'm getting a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'intl'
What is the right way to use this extension with php7.2?
As it states in your error, you are having broken packages so in that case, you should try to fix it, probably following commands will fix them.
apt update
apt autoremove
Once you have fixed that issue, you can try executing following commands if you have not added ondrej PPA:
add-apt-repository -y ppa:ondrej/php
apt install php7.2 php7.2-intl
I am installing a fresh kubuntu system 18.04, which is using by default php7.2
A composer install for my current software project gibves me this error message:
The requested PHP extension ext-mcrypt * is missing from your system.
Install or enable PHP's mcrypt extension.
Other than before there is no php-mcrypt available and other articles like this http://aryo.lecture.ub.ac.id/easy-install-php-mcrypt-extension-on-ubuntu-linux/ don't help since an analog php-mcrypt or php7-mcrypt does not exists.
How can I get a setup, which fulfills my requirement?
sudo apt-get install php7.2-ext-mcrypt
does not find an installation candidate.
Is there a difference between php 7.1 and 7.2?
not surprisingly this also does not do the trick:
$ sudo phpenmod mcrypt
WARNING: Module mcrypt ini file doesn't exist under /etc/php/7.2/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/7.2/mods-available
So it looks like mcrypt is deprecated with php7.2
So I will either have to replace it in my software or follow e.g. this howto to circumvent it:
https://serverpilot.io/community/articles/how-to-install-the-php-mcrypt-extension.html