3

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?

1
  • suhosin is more used for web-based security. there shouldn't really be a need to load it while in CLI mode, so removing it from the CLI .ini file shouldn't cause any trouble. Commented Jan 2, 2014 at 16:55

2 Answers 2

2

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-

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, for both solutions, what i was looking for was "E_STARTUP_WARNING", but it seems quite ugly just to mute the errors, so i had to fix the 2 erros. For the suhosin-error i just purged the package, because the file was missing (after updateing von squeeze to wheezy) "apt-get purge php5-suhosin" (source: blog.datentraeger.li/?p=3454). the idn.so error came from an new package php5-intl which did remove the idn package, but not completely (source: epunks.de/blog/artikel/…). thanks for the help
-1

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.

2 Comments

You should not remove suhosin !!
php5-suhosin is not part of Wheezy, why not remove old references. "Suhosin was removed from Debian as of version 7 (wheezy)" en.wikipedia.org/wiki/Suhosin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.