PHP not loading http.so - php

I updated my Mac to OS X Mavericks (10.9) and have had to setup PHP again, along with PECL OAuth.
When I verify my install with the command php -v, I am getting an error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/http.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/http.so, 9): Symbol not found: _php_persistent_handle_abandon
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20100525/http.so
Expected in: flat namespace
in /usr/lib/php/extensions/no-debug-non-zts-20100525/http.so in Unknown on line 0
PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)
Has anyone else come across this? Any idea what the issue could be?

I worked it out....had to install pecl_http-1.7.6.
# 1. Uninstall the current version with this command:
pecl uninstall pecl_http
# 2. Install an older version, at least until latest is figured out on Mac OSX 10.8+
pecl install pecl_http-1.7.6

I have fixed this issue by editing php.ini.
My pecl install pecl_http mixed it up and put few extension= lines on top of my php.ini in wrong order. The http.so has to be below propro.so and raphf.so according to dependencies.

Related

PHP Warning - PHP Startup: Unable to load dynamic library 'imagick.so'

Has anyone come across this warning before? Any files I should check other than php.ini or 00-ioncube.ini? Those look to be in good order.
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/lib64/php/modules/imagick.so (libMagickWand.so.5: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imagick.so.so (/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.3.31 (cli) (built: Sep 21 2021 10:24:03) ( NTS )
Operating System:
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.42.2.el7.x86_64
Architecture: x86-64
I upgraded PHP from version 7.1 to 7.3 on using these steps:
php -v
sudo yum install epel-release
yum --enablerepo=remi-php73 install php
php -v
systemctl restart httpd
I only see one php.ini file loaded in /etc/
Check how was the imagick extension was installed:
rpm -qf /usr/lib64/php/modules/imagick.so
It looks like it is not provided by a RPM, nor built for the proper PHP version you are running (libMagickWand.so.5 is also an old version).
For a proper configuration / installation, see the Wizard instructions
At least I recommend you enable the remi-php73 repository permanently, to ensure all extensions are taken from it.
yum-config-manager --enable remi-php73
Then you can install the imagick extension, or any other extension you need
yum install php-imagick
Notice, in this repository you have the choice between 2 variants of this extension, above command will pick one among:
php-pecl-imagick-im6 build with ImageMagick version 6 (libMagickCore-6.Q16.so.7, libMagickWand-6.Q16.so.7)
php-pecl-imagick-im7 build with ImageMagick version 7 (libMagickCore-7.Q16HDRI.so.10, libMagickWand-7.Q16HDRI.so.10)
APIs are slightly different.

Compiling PHP Intl extension on Mac Book Pro (El Capitan 10.11.4)

I am trying to install the PHP Intl extension on my new Mac (El Capitan 10.11.4) using PECL, but there is a linking error during the make stage.
Here are the steps I took:
Installed PEAR to run on Mac
Compiled and installed the ICU library (version 51.2) into /usr/local/lib
Ran this command: sudo pecl install intl and there was an error (see below). I also tried compiling the extension directly from the PHP source code ("ext" folder) and received the same error message.
I am getting the following error:
ld: file not found: libicudata.51.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [intl.la] Error 1
ERROR: 'make' failed
It looks like:
The file is missing (even though it knows the correct ICU library version to look for). Maybe it truly can't find the file. The -L switch and related switches appear to point to the correct path /usr/local/lib path.
Then, there is also some sort of architecture mismatch. So, I ran file libicudata.51.dylib and it appears to be the right architecture.
Here is what file retuned:
$ file /usr/local/lib/libicudata.51.dylib
/usr/local/lib/libicudata.51.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Has anyone run across this before? Or know how to compile PHP's Intl extension on the new Mac Book Pro (El Capitan 10.11.4)? I a hoping for some hints on where to look next, because I am a bit stumped here.
Maybe you can try just this:
brew install php56-intl
You might consider looking at these threads (https://github.com/Homebrew/homebrew-php/issues/1701) and (https://github.com/Homebrew/homebrew-php/issues/1710). I tried to reproduce your error but I failed. The most probable reason would be an icu4c that is not linked.
Try using brew link --force icu4c
I tried using php70 and
sudo pecl install intl
failed. I tried using php56, everything ran smoothly.
Try running php -v master, something like this should show up
C02QH2D7G8WM:workspace userone$ php -v master
PHP 5.6.20 (cli) (built: Apr 1 2016 08:53:48)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Try run:
brew install homebrew/php/php56-intl
I fixed this problem,here is my environment:
OS : El Capitan 10.11.4
PHP : php-7.0.5
icu : 55.1
the key point is reinstall ICU using --enable-rpath:
./configure --prefix=/opt/oss/icu --enable-release --enable-shared --enable-rpath --enable-tools
If you want to know why,please run as root
otool -L $YOUR_ICU_PREFIX/lib/libicudata.dylib
to check if the first library is absolute path.

Memcached is installed on PHP 5.3.28 on MAMP 3.0.3, but not working

I have a Drupal site running on fresh MAMP PRO 3.0.3 install with the PHP version 5.3.28 on OS X Mavericks 10.9.2.
I installed memcache with pecl install memcache and added the extension=memcache.so line in php.iniunder the extensions section, but still Drupal shows multiple You must enable the PECL memcached or memcache extension to use memcache.inc. errors on top of the page.
phpinfo() on the Drupal root directory tells me that the configuration file loaded is at:
/Library/Application Support/appsolute/MAMP PRO/conf/php5.3.28.ini
and the extension dir is:
/Applications/MAMP/bin/php/php5.3.28/lib/php/extensions/no-debug-non-zts-20090626/
$ cat "/Library/Application Support/appsolute/MAMP PRO/conf/php5.3.28.ini" | grep memcache
extension=memcache.so
$ ls /Applications/MAMP/bin/php/php5.3.28/lib/php/extensions/no-debug-non-zts-20090626/ | grep memcache
-rwxrwxr-x 1 user admin 65K Mar 28 14:00 memcache.so*
What am I doing wrong or is this problem related to MAMP PRO 3? I've installed the memcached binaries with homebrew and the process is running.
I'm also using the Individual PHP versions for every host setting in MAMP.
When starting Apache, there is an error in the logs:
PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.3.28/lib/php/extensions/no-debug-non-zts-20090626/memcache.so' - dlopen(/Applications/MAMP/bin/php/php5.3.28/lib/php/extensions/no-debug-non-zts-20090626/memcache.so, 9): Symbol not found: _zend_new_interned_string
Referenced from: /Applications/MAMP/bin/php/php5.3.28/lib/php/extensions/no-debug-non-zts-20090626/memcache.so
Expected in: flat namespace
in /Applications/MAMP/bin/php/php5.3.28/lib/php/extensions/no-debug-non-zts-20090626/memcache.so in Unknown on line 0
What does this mean.
Thanks for your help!
I did not get the memcache extension provided by pecl to work at all. I even installed PHP 5.3.14 but encountered the same problem. Then I cloned the php-memcached-mamp repository from github and used the memcached extension from there and it worked ok.
Add intl extension to your configuration.
I just found this problem and another post that helped me fix it. macports installed php-config53 (not php-config) and I had a vagrant php-config from an old php 5.4 install. Removed /usr/bin/php-config and symlinked php=config53 -> php-config, re-rean pecl install memcache-beta and it worked.

Cant get AMQP to load for apache2 on 64bit linux, php5.4

I have successfully PECL installed AMQP after installing rabbitmq-c as per the instructions at http://www.php.net/manual/en/amqp.installation.php
The .so file is created and I have added it to php.ini, but when I restart apache I get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/amqp.so' - /usr/lib/php5/20100525/amqp.so: undefined symbol: amqp_open_socket in Unknown on line 0
This happens on both Ubuntu 12.10 64bit PHP 5.4.6 and Ubuntu 13.04 64bit PHP 5.4.9
It does however work start up as expected on Ubuntu 12.04 32bit PHP 5.3.10
Has anyone managed to get AQMP to install on 64bit PHP 5.4? Does anyone know whether it is the PHP version or the fact that it's a 64bit OS that might be causing the problem?
Thanks
Looks like you don't have librabbitmq installed or librabbitmq version is incompatible with php-amqp extension or library placed in wrong location.

Installing intl on OS X 10.6.6: Invalid library (maybe not a PHP library) intl.so

I'm trying to install the PHP extension intl on my fresh install of OS X 10.6.6, using the PHP version that shipped with it (v5.3.3).
I know that the extension needs ICU so I installed it with homebrew. My installed version of ICU is 4.4.1 and is stored in /usr/local/Cellar/icu4c/4.4.1.
I tried two different ways to install the intl extension:
pecl install
pecl asked me for the ICU prefix, which is /usr/local/Cellar/icu4c/4.4.1. configure ran without problems, however make aborted with:
/private/var/tmp/apache_mod_php/apache_mod_php-53~1/Build/tmp/pear/temp/intl/collator/collator_class.c:107: error: duplicate ‘static’
make: * [collator/collator_class.lo] Error 1
ERROR: `make' failed
build directly
I downloaded the current version of PHP (v5.3.5) and then installed the intl extension from ext/intl by running:
phpize &&
configure --enable-intl --with-icu-dir=/usr/local/Cellar/icu4c/4.4.1 &&
make &&
make test &&
sudo make install
This seemed to work; I got an extension in the PHP extension directory and didn't get any error messages.
The file tells me: Mach-O 64-bit bundle x86_64
However, when I loaded the extension in php.ini, I got the message:
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) '/usr/lib/php/extensions/no-debug-non-zts-20090626/intl.so' in Unknown on line 0
I have no idea why this is happening. I'm guessing that it is because the extension is installed from PHP v5.3.5 and I am using v5.3.3, but I can't imagine that 2 bugfix releases would break compatibility.
Any Ideas?
UPDATE 2011-03-16:
I found a solution! When I explicitly set the -m64 flag in configure (which tells gcc to produce 64-bit code) then the extension loads correctly:
CFLAGS=-m64 CPPFLAGS=-m64 CCASFLAGS=-m64 ./configure
Maybe a little late, but here is a post on how to add intl to OS X Lion, using system tools:
http://mansion.im/2011/php-with-intl-and-gettext-on-osx-lion/

Categories