Question

everytime I start php in the console I get some warnings.

xx@peach ~ $php -i | echo "test";
test
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/idn.so' - /usr/lib/php5/20100525/idn.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0

considering the cli/php.ini there shouldn't be any warnings.

error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_USER_NOTICE
display_errors = On
display_startup_errors = Off

I checked the used php.ini file via

xx@peach ~ $ php -i | grep 'Configuration File'
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/idn.so' - /usr/lib/php5/20100525/idn.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini

I don't get it why the warning is displayed every time I start php from console. I thought using "~E_WARNING" would disable the warning?

Was it helpful?

Solution

I guess your filter does not work because these warnings are startup errors (IIRC : E_STARTUP_WARNING), not traditional warnings.

They occur because you have 2 extensions that are configured in your php.ini but can't be found in the filesystem :

/usr/lib/php5/20100525/idn.so

/usr/lib/php5/20100525/suhosin.so

This can be caused by 2 factors :

  • your extensions have been removed from filesystem, but not from your php.ini. In that case, just comment the 2 lines corresponding in your php.ini
  • the path for these extensions inside your php.ini is wrong. In that case, check where the extensions are on your disk and fix the path in the php.ini

If you want me to be more specific, I need to see your php.ini and the way php was installed on your machine ( distribution package or specific compilation)

Benjamin-

OTHER TIPS

The problem occurs after upgrading from Debian 6 Squeeze to Debian 7 Wheezy. On my installation it was resolved completely by:

apt-get purge php5-idn         (removed from Debian 7 Wheezy, has gone into php5-intl)

apt-get purge php5-suhosin     (removed from Debian 7 Wheezy)

Afterwards, issueing "php" does not bring warnings any more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top