PHPUnit dynamic library warnings - image not found - php

I'm having some problems with phpunit on my mac.
When I run phpunit, I get the following errors
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so, 9): image not found in Unknown on line 0
Any ideas why? I've manually added mcrypt to my system using this guide - http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10-6-1/
I'm confused as to why its looking for an image.
Thanks in advance.

I had this issue with xhprof and php installed with josegonzalez' homebrew:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php53/5.3.23/lib/php/extensions/no-debug-non-zts-20090626/xhprof.so' - dlopen(/usr/local/Cellar/php53/5.3.23/lib/php/extensions/no-debug-non-zts-20090626/xhprof.so, 9): image not found in Unknown on line 0
Turns out the problem was due to an extra line in the php.ini, probably a vestige from a previous install.
$ grep -RF xhprof .
./conf.d/ext-xhprof.ini:[xhprof]
./conf.d/ext-xhprof.ini:extension="/usr/local/Cellar/php53-xhprof/0.9.2/xhprof.so"
./php.ini:extension="xhprof.so" ; <-- this, why do I need to load xhprof twice?
Removing that line made the warning go away.

As described in a forum thread, the directory needs to be in your LD_LIBRARY_PATH.
First run
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/php/extensions/no-debug-non-zts-20090626/
$ php --version
You should get no more errors now.

For me the problem was that php was updated from 5.3.26 to 5.3.27 but the modules were only in the /usr/local/Cellar/php53/5.3.26/lib/php/extensions directory while php searched them in the /usr/local/Cellar/php53/5.3.27/lib/php/extensions directory. I just had to copy the extensions folder over from the old 5.3.26 location:
rsync -arv /usr/local/Cellar/php53/5.3.26/lib/php/extensions /usr/local/Cellar/php53/5.3.27/lib/php

Related

php not finding php_protobuf_ts and php_curve25519_ts

I am using php 7.1.12 on a windows PC, i have tried to install php_protobuf_ts.dll and php_curve25519_ts.dll extensions to php i keep getting this error
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp2\php\ext\php_protobuf_ts.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp2\php\ext\php_curve25519_ts.dll' - The specified module could not be found.
in Unknown on line 0
I am getting this error despite confirming that the above extensions exist on the specified directory. Please help, i have tried everything

When I want to see my php version, use the command "php -v", there show some warnings. How to solve it?

When I want to see my php version, use the command php -v, there show some warnings. How to solve it?
PHP Warning: PHP Startup: Unable to load dynamic library
'/Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/no-debug-non-zts-20121212/pdo_pgsql.so'
- dlopen(/Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/no-debug-non-zts-20121212/pdo_pgsql.so,
9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'/Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/no-debug-non-zts-20121212/pdo_pgsql.so'
- dlopen(/Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/no-debug-non-zts-20121212/pdo_pgsql.so,
9): image not found in Unknown on line 0
You have a php configuration file that try to loads the pdo_pgsql.so library, but the library isn't installed correctly.
You can either disable the library loading by removing the configuration directive loading it (you should have something like this:extension=pdo_pgsql.so) or install the pdo for php correctly.

PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0 [duplicate]

This question already has answers here:
Error In PHP5 ..Unable to load dynamic library
(13 answers)
Closed 1 year ago.
I've recently installed Cygwin to my new work laptop and ever since I've being bombarded with the above Warning message like commercial advertisements whenever I execute commands that involves php scripts
PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_tidy.dll' - No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_tidy.dll' - No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_tidy.dll' - No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_tidy.dll' - No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_tidy.dll' - No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/tidy.dll' - No such process in Unknown on line 0
I've done all the research (online) I could to remove this message / fix the problem. Also I can confirm the missing libraries are in fact NOT MISSING. My cygwin install directory is C:\cygwin. Although I couldn't find /usr/lib in Windows Explorer (C:\cygwin\usr), I could, however find it as well as the libraries in cygwin. Lastly, I tried to add all paths for Windows (C:\cygwin\lib) and linux (/usr/lib) to their environment specific path variables. None of these worked.
This might seem nothing but noise as it doesn't stop me from executing php scripts on command line. But I pretty sure issues like these are never negligible in later stages of development.
thanks Brett for his comment. When I did a search again, I found the following Stack-overflow page that answers my question
Error In PHP5 ..Unable to load dynamic library
The solution is around the following grep command suggested in one of the reply post
grep -Hrv ";" /etc/php5 | grep -i "extension="
As soon as I run it I found the ini file where I could comment the correct extension to get rid of php_tidy.dll message
My issue request fixes in a 2nd place, so as an extension to the above grep command, I used
grep -Hrv ";" /etc/php5 | grep -i "tidy.dll"
which gave me the location another file that requires similar commenting.
Updated both files (php.ini and tidy.ini) rid of the messages. Now my output looked much cleaner.
A more appropriate solution is to install the missing libraries via apt-get, which was discussed in other post. But most of the discussion relates to missing .so files, I'm not sure what to "apt-get" for the dlls. For the time being, I'm happy where I am.

where is php phalcon's config?

I installed phalcon follow it's Compilation document , the command showed that I install and build succeed. But when I run config script <?php print_r(get_loaded_extensions()); ?> it reported error:
PHP Warning: PHP Startup: Unable to load dynamic library '##HOMEBREW_PREFIX##/opt/php55-phalcon/phalcon.so' - dlopen(##HOMEBREW_PREFIX##/opt/php55-phalcon/phalcon.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '##HOMEBREW_PREFIX##/opt/php55-phalcon/phalcon.so' - dlopen(##HOMEBREW_PREFIX##/opt/php55-phalcon/phalcon.so, 9): image not found in Unknown on line 0
locate shows that there are two phalcon.so, the first was installed by phalcon's install sctipt, the second was installed by brew install php5x php5x-phalcon
/usr/local/Cellar/php55/5.5.27_2/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
/usr/local/Cellar/php55-phalcon/2.0.6/phalcon.so
I don't know where is the phalcon's config, maybe it found phalcon.so from the wrong place.
How to fix it?
edit:
I found the phalcon's config file and change the path of phalcon.so, and the error still there.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php55-phalcon/2.1.6/phalcon.so' - dlopen(/usr/local/Cellar/php55-phalcon/2.1.6/phalcon.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php55-phalcon/2.1.6/phalcon.so' - dlopen(/usr/local/Cellar/php55-phalcon/2.1.6/phalcon.so, 9): image not found in Unknown on line 0

How to get rid of PHP errors in Terminal after Mavericks upgrade

I recently upgraded my Mac to Mavericks, the new OS. As part of the upgrade, Apple updated PHP to 5.4. I installed the mcrypt extension for PHP, which went just fine in terms of mcrypt working and no installation errors.
But it had an unwanted side effect. Now, when I run a PHP command (like php -v) at the command line in Terminal, I get these errors:
PHP Warning: PHP Startup: Unable to load dynamic library '/php_pdo_firebird.dll' - dlopen(/php_pdo_firebird.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/php_pdo_mysql.dll' - dlopen(/php_pdo_mysql.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/php_pdo_oci.dll' - dlopen(/php_pdo_oci.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/php_pdo_odbc.dll' - dlopen(/php_pdo_odbc.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/php_pdo_pgsql.dll' - dlopen(/php_pdo_pgsql.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/php_pdo_sqlite.dll' - dlopen(/php_pdo_sqlite.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/php_sqlite3.dll' - dlopen(/php_sqlite3.dll, 9): image not found in Unknown on line 0
PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
As part of the mcrypt installation, I changed the extension_dir to the path for the mcrypt library. I think this is why I am getting this error. If I change the extension_dir to something else, it changes the path of these libraries in the error messages. If I comment out extension_dir, I get the directory of the mcrypt extension, which is /usr/lib/php/extensions/no-debug-non-zts-20100525/mcrypt.so.
So my question is, what path should I use so these libraries load? What is the default that is set in a PHP installation? I've Googled and can't find it. I thought it was ./, but that doesn't work. I believe, actually, that that line is commented out in the default installation, but like I said, commenting out the extension_dir doesn't work.

Categories